After a long time PlusNet? have decided to stop webhosting.
My Webpages needed migrating.
My old wiki database was uploaded to dougrice.co.uk
The links to dougrice.plus.com needed updating.
adding ?action=browse&raw=1&id= shows the text you edit
I can open each page to edit.
If I could load a file of JavaScript? that has a function to do the updates, I might be able to simplify it.
If function update() can read the text from the text area, I can use JavaScript? to update and replace references to the old web site to the new one.
You can load HTML when you go into edit mode. Edit wiki_edit.pl and configure it to include /update.js. It adds a button. click on the button and it does the update. It also does the Save
current https:/update.js
/* This is included into wiki.pl or wiki_edit.pl $EditNote? = "<P>EditNote?:<script src=/update.js ></script></p>"; # HTML notice above buttons on edit page */
update.js contains this.
// add a button to the edit page
document.write( "<button onclick=update() type=button > update </button>" )
function update(){
var forms = document.forms; // contains all forms
//alert( forms[0].fileNames.value ) console.log( forms ) console.log( forms[ 0 ].firstChild.text ) //alert( forms.length ) //alert( forms[ 0 ].text.value )
var lines = forms[ 0 ].text.value
var temp = ""
var temp2 = ""
temp = lines.replaceAll( "https:/cgi-bin/wiki.pl","https:/cgi-bin/wiki.pl" ) temp2 = temp.replaceAll( "https:/imagesc","https:/imagesc" ) temp = temp2.replaceAll( "https://www.dougrice.co.uk","https://www.dougrice.co.uk" ) temp2 = temp.replaceAll( "https:/www/","https:/www/" ) temp = temp2.replaceAll( "https:/www/","https:/www/" ) temp2 = temp.replaceAll( "https:/www/","https:/www/" )
alert( temp2 )
forms[ 0 ].text.value = temp2
}
//var linesA= lines.split("\n")
//update()
To see if this, I did and edit of a Wiki page., and copied the source code into wikiEdit.htm and edited this to develope this idea.
I did a view source of an edit and saved it to wikiEdit.htm saved on the desktop. I added the javaScript code and check it did what I wanted.
I then uploaded it to the website
I then uploaded it as update.js and edited wiki_edit.pl to set up
/* This is included into wiki.pl $EditNote? = "<P>EditNote?:</p><script src=/update.js ></script>"; # HTML notice above buttons on edit page */
It seems to work and I could open a page, press the update, and it does the save. Check if the images and links work.
I uploaded a back up of the database as wikidb0 and used wiki0_edit.pl and converted the pages a page at a time.
view a page:
https:/cgi-bin/wiki.pl?PIC_16F819_IIC_Serial_Demo_With_Debug_Of_SSPSTAT
https:/cgi-bin/wiki.pl?PIC_16F819_IIC_Serial_Demo_With_Debug_Of_SSPSTAT
https:/cgi-bin/wiki.pl?action=browse&id=PIC_16F819_IIC_Serial_Demo_With_Debug_Of_SSPSTAT
view the raw text: https:/cgi-bin/wiki.pl?action=browse&raw=1&id=PIC_16F819_IIC_Serial_Demo_With_Debug_Of_SSPSTAT
After a long time PlusNet? have decided to stop webhosting.
Static pages were stored on:
https://homepages.plus.net/dougrice | http://www.dougrice.plus.com |
Plusnet had a workaround for https: you needed to use https://homepages.plus.net/dougrice and the ccgi server did not support https:
Plusnet allowed PERL and PHP scripts at https://www.dougrice.co.uk
Plusnet allowed FTP access, so I used WinSCP? to backup and download my website to my PC.
I needed to replace links to images and files hosted on https://homepages.plus.net/dougrice , http://www.dougrice.plus.com and https://www.dougrice.co.uk
http://www.dougrice.plus.com and https://homepages.plus.net/dougrice were copied up to www.dougrice.co.uk/www
ccgi.dougrice.plus.com was copied up to www.dougrice.co.uk/ccgi and PERL script put in the cgi-bin folder.
I wanted move the files from www.dougrice.plus.com to dougrice.co.uk/www
Also I needed to change http: to https:
One problem with my websites was the use of src=./image.jpg and /image.jpg and href=js/menu.js
src=image.jpg local to the folder src=./image.jpg local to the folder src=/image.jpg uses the web site root
if you use src=/image.jpg, they expect the file to be in the root directory of c:
Windows subst was used to set up X: at the root directory of the backup.
If you set up drive X: at the website root directory, and use the WebBrower? to open x:index.html, the src= and href= links work.
I tried inplace updates, but I needed a separate source folder and destination folder.
I set up a folder www and did a subst y: .
Windows subst was used
cd to the folder where the download is stored.
subst x: .
use another subst for the output directory
subst y: .
as files were to be copied up to www.dougrice.co.uk/www I used
subst x: .
Windows tree was used to find all the .htm* files.
Windows dir was used to get a list of folders
Use thw X: drive to find the list of folders , and pipe this into a file.
X:\> dir /S /AD /b *
X:\>dir /S /AD /b * > doMkDir?.bat
I thought we needed to build the folder structure under the output folder y:
In the end I copied the source files to a destination folder www/ and ran an awk script to update the files.
Windows dir was used to get a list of files
X:\>dir /S /b *.ht* > opBat.bat
insert mawk -f t.awk "<filename>"
I wrote t.awk to read each line of the .htm files and replace dougrice.plus.com to dougrice.co.uk/www
https:/www/t.awk
mawk -f t.awk "X:\a2.htm"
mawk -f t.awk X:\btinternet\ship\ship.htm prompt pause exit
mawk -f t.awk "X:\a2.htm" mawk -f t.awk "X:\booking.htm" mawk -f t.awk "X:\bust.htm"
and all the other files
In the end I copied the files under X: to Y: and ran the batch file againt to update the .htm* files, so that the supporting image and .js files were present.
CPANEL allows you to upload a .zip file and then expand it.
I set up z:www and z:www was compressed and uploaded to the website and exploded.
This worked well
I used ccgi.dougrice.plus.com to host the modwiki wiki.pl
https://www.usemod.org/cgi-bin/wiki.pl is simple to set up.
I had also set up a wiki at dougrice.co.uk
Merging their database may have worked, but I needed to update the links to images and folders stored on ccgi.dougrice.plus.com and www.dougrice.plus.com
I can get a list of WikiPages? using:
https:/cgi-bin/wiki.pl?action=index
The pages with spaces in the names need to have the spaces converted to _
select all and copy into a text file and replace the " " with _
I used Treepad to save each page in my wiki. There are about 80 pages.
The raw wiki page you edit can be obtained using:
https:/cgi-bin/wiki.pl?action=browse&raw=1&id=
e.g.
https:/cgi-bin/wiki.pl?action=browse&raw=1&id=MigratingWiki
Set this up on the WebBrowser? so you can open it and append the page name helps.
I added https:/cgi-bin/wiki.pl?action=browse&raw=1&id= as a short cut.
I could have prepended this onto each page name and saved it in wiki page.
Save the raw text in a TreePad? Page.
I opened the TreePad? file in Notepad++ and used replace dougrice.plus.com
I then merged the pages with www.dougrice.co.uk/cgi-bin/wiki.pl
My Wiki is normally read-only, but I enabled edits
?action=browse&raw=1&id= ?action=edit&id=
if you add this to the Edge HomePage
https:/cgi-bin/wiki.pl?action=edit&id=p
The raw wiki page you edit can be obtained using:
https:/cgi-bin/wiki.pl?action=browse&raw=1&id=
This seemed to work
I wrote a webpage to help do the migration.
https:/www/migratePrep.htm using pages at ccgi.dougrice.plus.com/cgi-bin/wiki.pl
https:/www/migratePrepEdit.htm has more ideas.
The Wiki text can be obtained , click on the hypertext link and copy the text.
It could be possible to use curl and an pipe its output through an awk script. It stored the converted text in temp.txt
having set up x: and putting mawk.exe and t2.awk in the folder copy a line starting with curl. The output is in temp.txt
Open the wiki page for edit and replace the text
If I could load a file of JavaScript? that has a function to do the updates, I might be able to simplify it.
You can load HTML when you go into edit mode. Edit wiki.pl
/* This is included into wiki.pl $EditNote? = "<P>EditNote?:<script src=/update.js ></script></p>"; # HTML notice above buttons on edit page */
update.js contains this
document.write( "<button onclick=update()> update </button>" )
function update(){
var forms = document.forms; // contains all forms
//alert( forms[0].fileNames.value ) console.log( forms ) console.log( forms[ 0 ].firstChild.text ) //alert( forms.length ) //alert( forms[ 0 ].text.value )
var lines = forms[ 0 ].text.value
var temp = ""
var temp2 = ""
temp = lines.replaceAll( "https:/cgi-bin/wiki.pl","https:/cgi-bin/wiki.pl" ) temp2 = temp.replaceAll( "https:/imagesc","https:/imagesc" ) temp = temp2.replaceAll( "https://www.dougrice.co.uk","https://www.dougrice.co.uk" ) temp2 = temp.replaceAll( "https:/www/","https:/www/" ) temp = temp2.replaceAll( "https:/www/","https:/www/" ) temp2 = temp.replaceAll( "https:/www/","https:/www/" )
alert( temp2 )
forms[ 0 ].text.value = temp2
}
//var linesA= lines.split("\n")
//update()
This merges a lot of the website. Some of the PERL and PHP scripts were updated by hand
I used menu.js to include a menu into my web pages, but had not worked out the "x: and src=" trick.