This tool written in JavaScript and Python facilitates content migration. Feedbacks are welcome.
- Reads HTML source code from the editor, checks links, downloads files and uploads them to the right place.
- Provides an editable list of links.
- Install Greasemonkey if you are using Firefox or Tampermonkey if you are using Chrome.
- Install user script from Greasy Fork.
- Open
/json/ftp.json
with a plain-text editor. - You will see something like the following, fill the information and save the file.
{
"server": "ftp.example.com",
"username": "your_username",
"password": "your_password"
}
- Run
run.bat
. - Go to content space page editor.
- Paste content to the editor.
- Switch to HTML mode.
- Click on Load.
- Click on Strip if you want to remove formatting.
- Click on Start.
- Errors may occur, double-check whether some links redirect to files.
- Save your page.
- Run
run.bat
. - Go to external link page editor.
- Fill the form.
- Click on Check.
- Save your page.
- Go to your browser and press F12.
- Click on Network.
- Go to the site from which you want to copy content and log in.
- Find the relevant row in the network panel by checking the Domain.
- Locate the Cookie string under Request Headers.
- Add a attribute-value pair to '/json/headers.json' like the following and save the file.
{
"User-Agent": "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0",
"Cookie": "fill the cookie string here"
}
Follow the above instruction. You just need to include the Authorization string instead.
No, 'server.exe' can only check URLs for a single page at a time.
Yes, just make sure you don't start the automation.
Some websites cannot be accessed by non-browser clients. It is recommended to keep this in 'headers.json'.
In this case, you need to re-login to the CMS site and refresh the editor page.
This is because some sites use JavaScript codes in their anchor tags (ex. to pop-up windows). When you paste links to the editor, the href attributes are lost because JavaScript codes are not recognized by the HTML editor. In this case, you have to edit the URLs manually. You can directly edit the URLs in the link list.
- Ready: the URL has not been checked yet.
- Checking: the program is checking if the URL redirects to a file.
- Downloading: the program is downloading the file to '/temp'.
- Uploading: the program is uploading the file.
- Skipped: the URL does not redirect to a file.
- Done: the URL redirects to a file and has been replaced by the new URL.
- Error 4XX: HTTP errors. The target is not accessible or does not exist.
- Error: other errors.
- Session Expired: The user script cannot retrieve the information of the page you are editing. You need to re-login to the CMS site and refresh the page.