Note: The WordPress Toolkit extension is free with our Tera plans, and the Web Pro and the Web Host Plesk editions on a dedicated server or could VM. It is available for a fee for the Web Admin edition.
Synchronization of WordPress Sites
You can synchronize the content of your WordPress site including files and database with another WordPress site.
Let us say you maintain a non-public (staging) version of a WordPress site on a separate domain or subdomain and a publicly available (production) version of this site on a production domain. You may want to synchronize your WordPress sites in the following situations:
- You want to copy the changes you have made to the staging version to the production version.
- You want to copy the data from the production site to the staging site to see how the changes (for example, a new plugin) work with the production data. After checking that everything works fine, you may copy your changes to your production site.
- You have made some changes (for example, installed a new plugin) to the staging site, and these changes resulted in new tables being added to the database. You want to copy only these tables to the production site without affecting other data.
- You have upgraded the staging site to a newly released version of WordPress and fixed the post-upgrade issues (if any). You now want to push these changes to the production site.
- You can choose to synchronize the WordPress files, the WordPress database, or both the files and the database. When synchronizing the database, you can choose to synchronize all tables, or tables that are present on the source server but absent from the destination server, or you can specify individual database tables to be synchronized.
When performing the sync, keep in mind the following:
- The selected data are copied from the source site to the destination site. Any files and/or database tables present both on the source and the destination that are not identical are copied from the source to the destination. Files and database tables present only on the destination are not affected.
- During synchronization, the destination site enters maintenance mode and becomes temporarily unavailable.
- If the WordPress version on the destination site is earlier than on the source site, WordPress Toolkit first upgrades WordPress on the destination site to match the version installed on the source site, and then runs the synchronization.
- If the WordPress version on the source site is earlier than on the destination site, synchronization is aborted. To synchronize data, you need to upgrade WordPress on the source to the version installed on the destination or a later version.
- If the database prefix on the source and the destination differs, WordPress Toolkit will change the database prefix on the destination site to match that on the source during sync.
- Synchronization of data between a regular WordPress instance and a multisite one is not supported. We recommend using cloning instead.
Caution: During synchronization, files and database tables copied from the source overwrite those present on the destination. Any changes made to the files and database tables on the destination prior to synchronization will be discarded and lost without warning.
Note: If you have caching plugins installed on a WordPress website you want to synchronize with, clear the cache on the source website before sync. Otherwise, the destination website might work incorrectly.
To synchronize a WordPress site data with another site:
- Go to Websites & Domains and click WordPress in the menu on the right.
- Click the Sync button next to the name of the WordPress installation you want to synchronize.
- Under "Destination WordPress Installation", select the destination WordPress installation you want to synchronize the data with. This WordPress installation may be related to the same or another subscription.
- Under “Select Content to be Copied”, select which data you want to synchronize with the destination WordPress site:
- “Files Only” - synchronize only the website files, including the WordPress core files and the files related to themes and plugins. By default, the files .
htaccess
,web.config
, andwp-config.php
are not synchronized, as modifying these files may disrupt the operation of WordPress. You can have WordPress Toolkit synchronize thewp-config.php
file by selecting the "Synchronize wp-config.php" checkbox. To make the checkbox visible, go to WordPress, go to the "Global Settings" tab, select the "Allow to copy wp-config.php during file synchronization" checkbox, and then click OK.Note: Even if you choose to synchronize the
wp-config.php
file, the information related to the database will not be synchronized. This prevents the target WordPress instance from corruption. Custom settings specified in thewp-config.php
file on the target instance will be overwritten with those from the source instance. - “Database Only” - synchronizes only the database. You can select to import all, new, or selected database tables (for details, see the “Database synchronization” section below).
- “Files and Database” - synchronizes both the website files and the database. You can choose to import all, new, or selected database tables by selecting the corresponding option (for details, see the Database synchronization section below).
- “Files Only” - synchronize only the website files, including the WordPress core files and the files related to themes and plugins. By default, the files .
- If you selected “Files Only” or “Files and Database” during step 4, two more options become available:
- "Replace files modified on target" - by default, when synchronizing WordPress instances, if a file with the same name exists both on the source and the target instance and the file on the target instance is newer, the file from the source instance is not copied to the target instance, even if their contents differ. Select this checkbox to always overwrite files on the target instance with the files from the source.
- "Remove missing files" - by default, when synchronizing WordPress instances, if a file exists on the target instance but is missing from the source instance, the file is untouched. Select this checkbox to remove files on the target instance that are missing from the source.
You can hide these options, making them unavailable to yourself and your customers. To do so, go to
WordPress
, go to the "Global Settings" tab, clear the "Use rsync for file synchronization operations" checkbox, and then click OK. - When you are satisfied with the selected destination and the content to be synchronized, click OK.
- Before synchronizing WordPress instances, WordPress Toolkit suggests creating a restore point. You can use it to roll back the changes made during synchronization. If you do not want to create a restore point, clear the "Create a restore point" checkbox. Learn how you can recover your WordPress instance using the restore point in the "Restoring a WordPress Instance" section below.
Caution: Every WordPress instance can only have a single restore point. Creating a restore point overwrites the existing restore point, if any.
- Click Start to begin synchronization.
The synchronization of WordPress instances has started.
When the synchronization is finished, you will see a page displaying the settings of the source WordPress instance. On the page, you can see the last time synchronization was performed. You can click the “Visit the target instance.” link to see the target instance page opened in a new tab.
Database synchronization
When you choose to synchronize databases (that is, you have selected either the Database Only or the Files and Database option), you need to specify which database tables you want to synchronize:
- "All Tables" (the default option)
- "New tables"
- "Selected tables" - if you select this option, you can see the list of available database tables and select which ones you want to synchronize. If you want to synchronize all changes except for pages, posts, and users, you can select all database tables except the tables with the
_postmeta
,_posts
,_username
, and_users
suffixes, by clicking the corresponding link.
Comments
0 comments
Article is closed for comments.