While Duplicator does an extremely good job of moving your entire site and various sub-sections. There are some use cases where custom work-a-rounds are needed.In this section we try to cover those various options.
Scenario 1-AParts of Site
How to move only part of a website?
A WordPress site consist of two primary assets “Files” & “Database Tables”. By excluding these assets with filters you can create any version of a site you want.The installer (Pro Only) has features to re-deploy a package and exclude specific data froman existing package. Below are workflows that will allow you to filter/exclude data for you package.
File Management: When creating a new package you can exclude any files/folder, file extensions or database table you want. With Archive Filters(Packages > Create New > Archive > File filters) along with Overwrite orImport install modes users have the flexibility to move portions of there site. To move just aportion of your site exclude all the files that do not need to be moved. For file filters enter the full path of the directory(s) you want to exclude. You can separate additionalexclusion paths with a semicolon. This process can be useful if you havelarge files such as images or videos that you don’t want to package.
Database Management:Table filters (Packages > Create New > Archive > Database Tab > Table filters) will allow you to exclude any table from being added to the database.sql file which contains the dataneeded to restore your database.
At install time you can then perform the Overwrite or Import Install process which allows you to move only the files you have in the archive. Another key feature of the installerthe “Skip Files” option (Pro Only) on step 1 of the installer (Installer > Step 1 > Options > Skip Files). These options include the following:
- Extract all files: Extract all files from the package archive. This option is selected by default.
- Skip extraction of WP core files: Extract all files except WordPress core files. Choose this option to extract only the wp-content folder and other non-core files and directories.
- Extract only media files and new plugins and themes: Extract all media files, new plugins, and new themes. The installer will not extract plugins and themes that already exist on the destination site.
Scenario 1-BLarge Sites
How can I more quickly move larger sites/packages?
Option 1In the event you have a very large site that you need to continually move around and have issues with upload/download speeds you can quickly improve this workflow by using the“Classic Overwrite Install” method.
- You have two sites i.e. a Development and Staging site
- The sites files are identical except for their physical location.
- The sites databases are the same except for locations which could be the same or different servers.
- Create a new package on the Development site and exclude/filter the \wp-content\uploads\ directory.
This can also be other locations that might have large files.
- Download the package files locally then transfer them to your Staging site in the WordPress root
- Browse to the installer.php file on the staging site and exact the archive.
- Upon completion that Staging site should have all the updates of the Development site minus the filters from step 1.
- Since the sites were identical initially the \wp-content\uploads\ should still be functional on the Stage site.
Option 2The Duplicator import install mode can rapidly improve your workflow.
Scenario 1-CSync Dev to Prod
How to sync a staging/development site with a large production site?
- Install Duplicator Pro on both sites
- On the main site set the engine to DupArchive (Settings > Packages > Archive Engine = DupArchive)
- Build a package on your main site
- Perform an import URL install as described here Import Link section
After doing the above your staging site will match the original site. After the upgrade you can then perform the reverse procedure. Note that the database gets fully replacedwhen a package is installed (so if you have any customer payments or other records coming in on the main site while you are working on the staging site then those would get erasedwere you to install the staging site back onto the main site)
Database Specific Scenarios
Scenario 2-ACustom SQL
How can I manually execute my own custom SQL file?
In the event you need to execute custom SQL code instead of what is placed in the archive via that database.sql file. This process can be done by following these instructions:
- In a new browser tab, go to phpAdmin or the equivalent on your destination machine.
- Remove existing database tables from your the destination database.
- Import your own custom script (this should represent a copy of your site in most cases).This can be done via the phpMyAdmin import procedure.
- Launch the Duplicator Pro installer.php in a browser tab
- Switch to Advance Mode > Choose “Manual SQL Execution” from the database option.
this will prevent the installer from using the .sql within the archive and skip past the data insertion step all-together.
- Finish the install process
Scenario 2-BExisting Tables
How to prevent existing database tables from being changed during a migration?
Option 1There may be situations where you need to keep an existing table on a particular site. For example say you have development site (dev site) and a staging site. On the staging siteyou do NOT want to overwrite any of the sites current posts from the wp_posts table. In order to retain the table follow these steps.
- Login to your development site and goto Duplicator Pro > Packages screen > “Create New” button
- Archive > Database Tab > Check “Enable Database Table Filters” > check “wp_posts” table & build package
Note: This will exclude/ignore the “wp_posts” table from being created in the database.sql script
- On staging site open the installer.php and location the “Setup” area on Step 1.
- Choose Action “Overwrite existing tables” > Click the “Validate” button
Note: This will keep all the existing tables in the database and overwrite those with the same name.
- Validate the “wp_posts” table is NOT in the removal list
See: Validate tables Validate > Database > “Tables Flagged for Removal or Backup”
- Continue with the install process & upon completion the “wp_posts” table should remain unchanged
Question A Is there a setting for incremental or differential backups?
Option 1At the moment Duplicator does not support differential or incremental backups. Many people use filters to cut back on backup size, though – for instance you could do a full backup withall files every week or x days and then a database only backup every x hours or every day, based on your needs.
Question B How can I copy ONLY the blog posts (with images, comments, categories, tags, etc.)?
Option 1Duplicator does not currently migrate individual items such as just blog posts, however the WordPress import/export tool combined with FTP transfer of files should allow users to do this process.More details about this process can be found here.