Introduction to Clean Import

The Clean Import tool is designed to help improve the import process for DesktopServer by standardizing the import archive. It does this by making changes to the WordPress installation, renaming some files, disabling certain plugins, and removing certain data from the database based on your configurations. The result is that the imported site is able to run in your local environment because known conflicts are removed.

Clean Import performs the following changes:

  • Backup the current wp-config.php from the archive to wp-config.php-sav-##.
  • Create a standard wp-config.php file.
  • If any .php files are found in the wp-content/mu-plugins/ directory, these are renamed to have a .php-sav-###.
  • If an .htaccess file exists, it is renamed to .htaccess-sav-###.
  • If a plugins/jetpack/ directory exists, add a define( 'JETPACK_DEV_DEBUG', TRUE); to wp-config.php.
  • If a wp-content/advanced-cache.php file exists, it is renamed to wp-content/advanced-cache.php-sav-###.
  • If a wp-content/cache/ directory exists, it is deleted.
  • If a wp-content/object_cache.php file exists, it is renamed to wp-content/object_cache.php-sav-###.
  • If a wp-content/wp-cache-config.php file exists, it is renamed to wp-content/wp-cache-config.php-sav-###.
  • If a wp-content/w3tc-config/ directory exists, it is renamed to wp-content/w3tc-config-sav-##/.
  • If a wp-content/wp-rocket-config/ directory exists, it is renamed to wp-content/wp-rocket-config-sav-###/.
  • Checks for a list of known plugins that are incompatible with local development sites. If any of these are found, the directories are renamed with the -sav-### suffix in order to disable them. The plugins are: advanced-cache, all-in-one-wp-security-and-firewall, broken-link-checker, cdn-enabler, dynamic-related-posts, gd-system-plugin, gd-system-plugin.php, ithemes-security-pro, iwp-client, managewp, portable-phpmyadmin, quick-cache, quick-cache-pro, sg-cachepress, stream, sucuri-scanner, versionpress, w3-total-cache, wordfence, wp-engine-snapshot, wp-fastest-cache, wp-file-cache, wp-phpmyadmin, wp-rocket, wp-super-cache

Note: where you see "-sav-###" above, this is a placeholder. The ### is replaced with the current timestamp of when the Import action is performed.

In addition to the plugins mentioned above that are always disabled, several other plugins can be configured to be renamed (effectively disabling them from the WordPress install). The default behavior for these plugins is to rename them, but if you wish, you can change the configuration to cause these plugins to not be renamed.

The plugins are as follows: adminer, async-google-analytics, backup, backupbuddy, backup-scheduler, backupwordpress, backwpup, bad-behavior, content-molecules, contextual-related-posts, duplicator, ewww-image-optimizer, ezpz-one-click-backup, file-commander, fuzzy-seo-booster, google-xml-sitemaps-with-multisite-support, hc-custom-wp-admin-url, hcs.php, hello.php, jetpack, jr-referrer, jumpple, missed-schedule, no-revisions, nrelate-related-content, ozh-who-sees-ads, recommend-a-friend, seo-alrp, si-captcha-for-wordpress, similar-posts, spamreferrerblock, ssclassic, sspro, super-post, superslider, sweetcaptcha-revolutionary-free-captcha-service, text-passwords, the-codetree-backup, toolspack, ToolsPack, tweet-blender, wordpress-gzip-compression, wp-database-optimizer, wp-db-backup, wp-dbmanager, wp-mailinglist, wp-postviews, wp-slimstat, wp-symposium-alerts, wpengine-migrate, wpengine-migrate.tar.gz, wpengine-migrate.zip, wpengine-snapshot, wpengine-snapshot.tar.gz, wponlinebackup, yet-another-featured-posts-plugin, yet-another-related-posts-plugin

The final work performed by the Clean Import tool is to optionally remove certain types of content from the database. You can configure Clean Import to remove or update Transient data, remove any Trashed posts, remove Post Revisions, remove Trashed Comments and remove any orphaned postmeta or usermeta data. All of these options are defaulted to not remove any data. So if you wish any of these types of data to be removed on import, you need to configure Clean Import to do so. You can do this in one of two ways: 1) Using the WordPress Dashboard on any existing site within DesktopServer: Go to the Tools -> DS Clean Import page and configure the behavior as you wish. or 2) Using the DesktopServer localhost page, use the Tools -> Clean Import Settings menu option, or go to the http://localhost/clean-import/page.php. Here you will find the same configuration options.

Configuring these options will store your configuration settings and use these settings for any future Imports done with the Clean Import Design Time plugin activated.

Installing Clean Import