Copying one WordPress website to another

Copying one WordPress website to another

If you are copying one WordPress website to another, read on.

Here you are going to see how this task is done using the file option within the All-in-One WP Migration WP plugin to help with this task.

From time to time you may want to create another WordPress website based completely on the contents of another of your existing WordPress websites. Here I talk about using the file option within the All-in-One WP Migration WP plugin to help with this task.

This is a good solution if the total content of your source WordPress website is less than 64MB. If you do not know the size of your source WordPress website, you can use the backup option inside of the All-in-One WP Migration WP plugin using the “backup to file” option, and the plugin will inform you of the file’s size after it does the save. At that stage you have the option or not to save that file to your computer’s disk. In any case, the plugin has added that file to a list. From there, you can download or restore or delete that file with its contents from that list.

If your total content is above 64MB, you might be able to exclude some types of content (spam comments, post revisions, media files, WordPress Themes, WordPress Plugins) from the export process to get the remaining content to be less than 64MB.

Post revisions over time assuming you write detailed long posts on a regular basis can use up quite an amount of space. Media files also can use up an amount of space, especially if over time you have used a number of different WordPress Themes which use different image file sizes for Thumbnail size, Medium size and Large size. You upload one image into your WordPress Library and WordPress behind the scenes could be adding four. One sure way to use up a lot of space especially if you upload a lot of images into WordPress. And if a number of those images were “work in progress” type of images, it is possible that a lot of your images in your WordPress Library are not actually referred to elsewhere within your WordPress installation, using up unnecessary space.

WordPress Themes and WordPress Plugins can be installed and activated in the target website after the All-in-One WP Migration WP plugin import process is complete. The concern is that all related settings and all related configurations may have “got lost”. You would have to double check these and reapply them if necessary. That would be a time consuming task.

Personally I use one active WordPress Theme and the default WordPress Theme is not currently activated. I would delete any other unused WordPress Themes from the source website. If necessary, I would delete the default WordPress Theme from the source website because I can simply re-install it on the target website after the All-in-One WP Migration WP plugin import process is complete. I don’t care about its settings or configuration as that WordPress Theme is only there as a catchall if something untoward happens to my active WordPress Theme.

Likewise depending on how much space I needed to remove, I would look carefully at the WordPress Plugins I have installed on my source website. If I have say twenty, and am using only save twelve of them and have not used the other eight for some time and don’t think I would be using those eight in the foreseeable future, I would consider deleting them. After all, installing and activating many WordPress Plugins is a simple enough task, and many do not have any settings or configurations I would have to be concerned about, especially if I don’t change them from their default settings.

Once that excluded content is excluded and the remaining content is imported into your target website, you then import manually (using other means outside of this particular plugin) the excluded content (media files, WordPress Themes, WordPress Plugins). This is a very doable process however is very involved and a bit technical. Not everyone’s cup of coffee or tea! πŸ™‚ πŸ™‚

There is no need of course to bring across spam comments or post revisions.

For a WordPress website where the total content is less than 64MB, this is usually a fairly easy process. Where the total content is more than 64MB it is more involved however still a fairly easy process when say a major reason for the “overlap” are related to spam comments and/or post revisions and/or the contents of the WordPress Media Library and/or a few WordPress Themes and/or a few WordPress Plugins. Anything more it becomes harder to ensure that everything is covered in a time effective manner.

The developers of the All-in-One WP Migration WP plugin have developed another offering called All-in-One WP Migration Import. This comes in two options – Basic and Premium. Basic is free and caters for files less than 512MB. Premium caters for large websites and has a cost associated with it. This post will not be discussing the All-in-One WP Migration Import further. The reason is simple, I have not used it so I can’t comment on it. πŸ™‚ πŸ™‚

Back to this 64MB limit, it is not directly imposed by the All-in-One WP Migration WP plugin. It is imposed by WordPress settings and/or by your webhost. Although I believe it is possible to overcome this limit by changing WordPress settings and/or by working with your webhost. However in my opinion, by doing this it is possible to break your WordPress website. Four options are suggested. Option one is to update the webserver’s configuration file. Option two is to update the website’s WordPress configuration file. Option three is to reach out to the webhost. Option four is to use their All-in-One WP Migration Import plugin.

I actually tried the first two options. One at a time and broke my website in each case. I was lucky as I knew what I did and was able to undo the change. Undoing the change was a bit involved as I had broken my website. I used ftp (well FileZilla to be exact, my preferred ftp tool of choice) to get at those underlying files. I transferred those files from my website to my computer, used my editor to change them, and then transferred those updated files from my computer to my website. So a bit of an involved process to undo those changes which did not work.

So although I had fixed my website, my file limit was still 64MB. I will not be discussing this further as even if you know what you are doing, it is possible to break your website. Fixing a broken WordPress website can be a challenge. You may have to revert back to a backup. You do not want to find out then, that your backup process and restore process is not solid and does not work.

My webhost backs up my websites every day. However I do not 100% rely on that daily backup as I live in the “real world” and understand it may have failed for any number of reasons. As a matter of policy my webhost only keeps the last daily backup, otherwise they run out of disk space. Anyway, I usually make my own backups prior to making major changes to my website, especially if WordPress itself has been updated or if the WordPress Theme I use is updated has been updated or if a key WordPress Plugin has been updated.

I also maintain a text file on my laptop with my own php code enhancements as well as my own css changes. Having this text file makes it easy and fast for me to check that my enhancements are still there and reapply them when they are not. It also means that I do not have to remember these changes. I have a number of ‘smallish’ enhancements which at this stage only affect a few php files (less than 100 lines of php code in less than 10 php files) and the additional css section (less than a thousand lines of css code) within my theme.

Back to this process of copying one WordPress website to another. The notes below assume that you are already familiar with WordPress, WordPress plugins, WordPress themes, ftp, FileZilla (my ftp tool of choice), etc.

Preparation

  • Very Important: Both the source website and the target website should be backed up prior to doing this process. That way you can revert back to the backup should the need arise. You need to be 100% certain that that backup and restore process is solid and error free.
  • Have full WordPress administrator access to both the source website and the target website
  • Have full ftp access to both the source website and the target website
  • Both the source website and the target website are on the same release of WordPress
  • Both the source website and the target website are using the latest same release of the All-in-One WP Migration WP plugin – This plugin is updated on a regular basis so using the latest same release of this plugin on both the source website and the target website makes sense
  • Optional however recommended: Housekeeping on source website – Delete any unused WordPress Themes (Assumes you can get these themes again if you want to)(Note settings, etc if you have to as once deleted this information may be gone forever)(Don’t delete the standard WordPress Theme or the current active theme)
  • Optional however recommended: Housekeeping on source website – Delete any unused WordPress Plugins (Assumes you can get these plugins again if you want to)(Note settings, etc if you have to, as once deleted this information may be gone forever)
  • Optional however recommended: Housekeeping on source website – Optimizes the WordPress Database after cleaning it out – I use the Optimize Database after Deleting Revisions WordPress plugin to do this.

Determine Find and Replace phrases

Often when moving the content from one of your WordPress based websites to another of your WordPress based websites, there are phrases in your source website than need to be replaced with an appropriate phrase on your target website. Manually finding and replacing these phrases is a time consuming task. However using the All-in-One WP Migration WP plugin export function gives you the opportunity to specify as many as you like “find and replace” commands.

Make a list of source phrases from the source database on the source website that will need to be replaced on the target database on the target website. Writing down a list on paper or to a computer text file makes a lot of sense. That way you can fine tune your “find and replace” strings over time.

For instance your source website might be called “AAB.COM” short for “All About Batteries”. Your target website might be “BatteryTechnology.com”. So you might have a list as follows:-

Source phrase Target phrase Notes
AAB BATTERYTECHNOLOGY Includes AAB.COM automatically
aab batterytechnology All lower case
Aab Batterytechnology Lead character in upper case, rest lower case
All About Batteries Battery Technology Check makes sense in website content
All about batteries Battery technology Check makes sense in website content
all about batteries battery technology Check makes sense in website content

You get the idea. You want to ensure that the phrases make sense because the process will replace all the source phrases with the target phases. After the copying process is complete, you should check your ‘copied to’ website to ensure that the target phases made sense and edit them where necessary.

Source website

  • Log into the WordPress Dashboard, select All-in-One WP Migration, select Export.
  • Complete the Find and Replace phrases. Do one Find and Replace at a time, until all the Find and Replace phrases are specified.
  • Click on Advanced Options – You see a list of things not to export.

On pass one, don’t click on any of them. If all of this content is less than 64MB, you would be in a good place. So do the export and see how big the file is.

Click on the “Export to” box and select file from the list. The export process begins – this builds up a file that can be exported. Once this file is built, you are informed of its size and given the option to download it.

If the file is less than 64MB download it to your computer. And then close this export file process. Then jump to Target Website below.

If the file is greater than 64MB, return back to the list of things not to export. Ensure that your list of “find and replace” phrases are specified. Click on Advanced Options if need be. You see a list of things not to export. This time round, click on “Do not export spam comments” and “Do not export post revisions”.

If all of this content is less than 64MB (excluding spam comments and excluding post revisions), you would be in a good place. So do the export and see how big the file is.

Click on the “Export to” box and select file from the list. The export process begins – this builds up a file that can be exported. Once this file is built, you are informed of its size and given the option to download it.

If the file is less than 64MB download it to your computer. And then close this export file process. Then jump to Target Website below.

If the file is greater than 64MB, return back to the list of things not to export. Ensure that your list of “find and replace” phrases are specified. Ensure that the items clicked on the last export are clicked again and click additional option or additional options.

Anything that you exclude may have to be “brought across” to the target website using alternative means AFTER completing the All-in-One WP Migration Import process. The bringing of all necessary excluded content across to the target website is what makes this process way more involved.

Do not export media library (files)

These are the media files (eg image files) associated with your WordPress website. If you exclude these files from your export from the source website, then they need to be included in your import to the target website later.
Use ftp to copy them from your WordPress source website over to your computer. FileZilla is my ftp tool of choice. The WordPress library of media files is usually located in the uploads folder within the wp-content folder within WordPress hosted sites.

Do not export spam comments, post revisions, WordPress Themes, WordPress Plugins, etc

Anything you exclude may have to be brought across to the target website later. Naturally there is no need to bring across spam comments unless you want them for some reason. πŸ™‚

Likewise there is no need to bring across post revisions assuming that you do not plan on reverting back to an earlier post revision of a post or page.

WordPress Themes and WordPress Plugins: Assuming you have not modified the underlying code in the WordPress Theme or WordPress Plugin, AFTER completing the All-in-One WP Migration Import process, you might be able to install and activate those in the usual manner. They might then ‘pick up’ the earlier settings. It is also possible that they do not ‘pick up’ the earlier settings.

You will need to check this yourself and take corrective actions if need be if this did not happen in your case.

Target website

Log into the WordPress Dashboard, select All-in-One WP Migration, select Import. Use the drag and drop function to grab your import file from your computer. And let the import process complete. This removes the existing content from the target website and imports the content from that import file. Follow the instructions that the tool provides.

Once this process is complete, remember to also “import” the excluded content.

If you selected “Do not export media library (files)” in the Export

AFTER completing the All-in-One WP Migration Import process on the target website, use ftp from your computer (where you stored those media files earlier) to the applicable folder on your target website. Once this process is complete, check that you can “see” these files are there on the server (FileZilla is great for this). Then check your WordPress Media Library. It is possible that you do not see these media files in your WordPress Media Library. This is because these media files have to be “introduced to WordPress” before they can be seen in the WordPress Media Library. My experiences of WordPress plugins to do this:

  • The Add From Server WP plugin would not perform this mass registration as it pointed out in its view details page. I tried to do that but it did not work. It would do one at a time.
  • I did some research and found the Media Sync WP plugin. I gave it a go and it seems to have done the job. It also has some additional built in logic to ignore WP generated thumbnails. However I had issues with it when running it again.
  • The Bulk Media Register WP plugin may do this. It takes a bit of figuring out how to use however seems to be able to do the job.

Note: Other WordPress Plugins may also do this task.
Note: I was using a trial and error approach when I did this process. I “deleted” those “introductions” during that trial and error approach. It is very possible that whatever sequence you follow that those “introductions” do not get “deleted”. However if they do get deleted, you are aware of a few WordPress plugins which may help you to resolve this issue. So, all good. πŸ™‚ πŸ™‚

You will need to check this yourself and take corrective actions if need be if this did not happen in your case.

If you selected “Do not export spam comments or post revisions or WordPress Themes or WordPress Plugins or etc” in the Export

Anything you exclude may have to be brought across to the target website later.

  • Naturally there is no need to bring across spam comments unless you want them for some reason. πŸ™‚
  • Likewise there is no need to bring across post revisions assuming that you do not plan on reverting back to an earlier post revision of a post or page.
  • WordPress Themes and WordPress Plugins: Assuming you have not modified the underlying code in the WordPress Theme or WordPress Plugin, AFTER completing the All-in-One WP Migration Import process, you might be able to install and activate those in the usual manner. They might then ‘pick up’ the earlier settings. It is also possible that they do not ‘pick up’ the earlier settings.
  • You will need to check this yourself and take corrective actions if need be if this did not happen in your case.

Additional resources

If you liked this, you might also like:
Hi, I'm David. I write articles such as this one. Enjoy! I like to hear from my readers so please leave me a comment below to let me know if this article helped you or if you have any related questions. Thanks.

Leave a Comment