WordPress Import & Export Tool
- 24-07-2022
- chuong xuan
- 0 Comments
- Lesson number: 24
- Year of implementation: 2021
- Belonging to the project: A Beginner's Guide to Using WordPress
The WordPress import & export tool helps us to migrate the site as needed, especially in case you change hosting or change the domain name for your website.
However, the output data is not the entire site, it does not contain data about plugins, themes and settings so even in the most perfect case, after the migration, you still have to do a lot of work. to restore the old website to its original state. .
Mục lục
1. Export data
To export the data, click Tools > Export (Vietnamese version):
And the English version is Tools > Export :
In the export selection area, select all, so that WordPress will export all site related data (including all posts, pages, comments, categories and tags…):
Similarly, with the English version:
Depending on how many articles your site has, we will have different .XML file sizes.
You may be curious to ask, about 10 photos are more than 1MB, why over 50 posts only have 1.3MB of data? The reason is that this XML file is text, it contains the path of the image, but does not contain the actual image inside. That is also the reason when changing hosting (where the domain name remains the same), you need to actively copy the original image file in the old website folder to your computer and then switch to the folder containing the image of the new website.
Another note to avoid misunderstanding, when you export data and the website still works normally, it is like copying a certain book, that copy is taken away but the original book still has no effect. .
2. Data entry
To enter data, in the Vietnamese interface, go to Tools > Input :
In the English interface, enter Tools > Import :
In the input interface, we see that WordPress provides a lot of tools to support exporting data from different sources, for example Blogger's blogspot has its own tool (we wrote a pretty detailed article about it) . on how to convert a site from Blogger to WordPress without losing Google rankings and it also uses the mentioned import/export tool).
In this case, since we are exporting data from WordPress, we use the data import tool for WordPress, here is the final tool (Vietnamese version):
Committee English:
After successful installation, it changes to Run Importer / Run Importer. You click on that, then Choose File (get the XML file you exported in part 1) and click Upload file and Import :
The maximum size it allows is 64 MB, in case you exceed this size (say you have up to 2000 articles) the trick is that in part 1 when you export you export each article separately:
- Posts
- Page
- Comments and others
Such subdivision and data entry one by one still gives the same result, not exceeding the maximum limit.
The following options will appear after you tap Upload file and import:
You will enter the authors of the articles that are being transferred (where to enter the author) to the new site, by default these authors will hold the role of subscribers (registered members).
Next because www.chuongxuan.com and 1wp.chuongxuan.com are 2 different domains and still work in parallel during data export and import, which means you won't need to transfer photos and other data manually to the new server, just tick the Download option and import the attachment so that it automatically transfers the data.
Finally, you click Submit to perform the data import process.
It will take a while for the new data import to complete (the larger the XML file, the longer it will take).
If the import is successful, you'll see the old site's articles appear on the new page, with identical content, same publication date, and comments if any will be fully copied:
To ensure that not only text content but also images are transferred to the new server, right click on any image on the new web to check if its path is from the new web. ? If it's from the new site, that's fine, but the image link is still from the old site, there's a problem in the transfer process.
Result:
This is a success, because the image link is from the host of the new domain (1wp.chuongxuan.com/..).
Even in the most favorable case (2 different domains and each domain is usually connected to the server), through the XML file we will only be able to transmit up to the entire content of the website including all website content. Text content, images, attachments, comments, but plugin settings will not be passed as mentioned in the beginning.
In addition, the input does not affect the articles already on the previous page.
3. Some other problems
If after importing data, there is a checkmark to Download and import attachments but in the end still no images appear, it means that the old server's link is no longer able to connect to the server. That makes the old image not display and the new image not, because it died because it could not connect to the photostore on the old host to copy to the new host.
The above case often happens when you move host but keep the same domain name, for example, the domain name is www.ducanhpsy.com but you move from host A to host B. Then disconnect the domain name from host A to connect the domain name . with server B. When I upload the XML data, the text is uploaded to server B, but the image files or other data are still in server A and now cannot connect to transfer to server B. B.
At this point the only solution is that before disconnecting from server A you have to download all images and attachments then when connecting to server B re-upload there using the program FTP client (doesn't have to download each image). This again requires you to learn some more complicated things, in addition, if the site is larger than 500 articles, this method will be very time consuming.
If you have 2 domains, there's a little trick so you don't have to suffer like the case above. Specifically, you will borrow the other domain name as an intermediary.
For example, you have domain A and need to move from server H1 to server H2. Also you have domain B. Then you just need to create a subdomain for domain B (like 1wp.ducanhplus.com), then you move the entire website A to subdomain B, since they are 2 different domain names. so it will transfer the whole content.
Next, you disconnect domain A for host H1 and move it to H2, now A is completely empty. Now you're exporting the entire contents of subdomain B to A again, and since they're 2 different domains, they'll transfer the whole thing.
Finally, thanks to subdomain B as an intermediary, you can transfer the host from H1 to H2 without having to re-upload the image by FTP, which is very time consuming.
4. Does the data export tool help us back up our website?
Website backup is an operation to prevent data loss, then we have something to restore the website (restore all content, themes, plugins, settings, etc., as is). , no chipping).
However, the data export tool only shows us the XML file without images and other attachments as well as plugins and themes, so it cannot really be a standard backup tool.
But if the visuals of a website don't make much sense, the text is the focus, and the plugin is easy to restore (it can take as little as an hour to reinstall the whole thing), then this data export tool might be a good idea to consider. . is a simple but useful backup tool.