New to the unlimited edition of DesktopServer version 3.2.5 is the Import / Export menu option. This option will enable you to import and export your entire WordPress website as a single ZIP file archive.

Import and Export can be used for a variety of purposes, but most notable are:

  • Sharing with co-workers or collaborating on a project.
  • Archiving complete solutions and configurations.
  • Import an existing website for redesign.
  • Transport between workstations.
  • Deploying to a live server.

As of this writing, this feature has been tested on all platforms with websites that averaged less then 500 megabytes in total size. This shouldn’t be an issue for most developers given that most WordPress.com sites hardly break the 100 megabyte content mark; significantly less if you are deploying a new site where content has yet to be established. However, Multisite and heavy content providers of video and multimedia should note possible hardware limitations that might inhibit import/export and their workarounds at the bottom of this post (see the Limitations section for tips on successful transfer of very large websites).

The Export Feature

Exporting will allow you to transfer a site to another DesktopServer user or you may use this feature to deploy your site to a live server on a hosting provider. Start by selecting the “Export or import a website” option and click next, followed by the “Export a WordPress website archive” option and click next. You will be presented with the following screen featuring a number of fields. Only the first field is required. The remaining fields are optional depending on your goal for the export destination.

An explanation of the fields and user interface controls follow:

  • Website – Required. This combo box lists all the websites that you have installed in DesktopServer. Simply select the website you wish to export.
  • Database Name, Username, Password, and Host – These fields are only relevant if you are manually deploying your site to a live web server at a hosting provider. The fields correspond to the wp-config.php settings and should contain the credentials for connecting to your live host’s MySQL database server. Otherwise, they are ignored when transporting your site to another DesktopServer. You may also omit these fields if you already have a basic install of WordPress on your live host and wish to use the beta “Quick Deploy” feature.
  • Extract from wp-config.php – Press the button to display the file open dialog window for selecting an existing wp-config.php file. The fields will automatically populate with the credentials from the selected wp-config.php file. The credentials will then be used in the exported wp-config.php file that is stored in ZIP archive.
  • Make site visible to search engines – This check box is turned on by default in anticipation that you may be exporting to a live web server. This check box mirrors WordPress’ Settings ? Privacy menu and is ignored (set to false) when re-importing into another DesktopServer.
  • Purge post and page revisions – This check box deletes all revisions that can accumulate while developing your WordPress website content prior to deployment. You can reduce the overhead and file size of your website archive by ensuring this setting is checked. Un-check the check box to preserve revisions.

Websites imported or created using DesktopServer have always had their privacy set to block search engines. This is to prevent false network traffic during development and stop ping services that would otherwise confuse search engines that attempt to reach your unreachable and fictitious .dev (dot DEV) website. The ‘Make site visible to search engines’ check box will override this setting when exporting to ensure visibility.

Note: Transferring the database manually outside of DesktopServer’s export feature such as via phpMyAdmin or by using another product (i.e. BackupBuddy or WP Twin) will copy the setting to block search engines. You may change the setting using WordPress’ admin Settings ? Privacy menu to meet your SEO endeavors in your deployed website.

After setting the minimum first field (Website) requirement, you may click next to continue.

An explanation of the fields and user interface controls that appear next follow:

  • Site Name – This is the site name of your deployed WordPress website. Be sure to include your registered and valid domain name that includes a real top-level domain (such as .com, .org, .info, etc.). The top-level domain will be ignored and replaced with .dev (dot DEV) if you intend to import the website back into another DesktopServer.
  • File Name – The file name of the zip archive that will contain your website. You may choose any name you wish, but It is important that you do not rename the file after export to maintain compatibility when deploying to a live server or importing back into another DesktopServer on another computer platform (Mac OS X or Windows).
  • Export Path – This is the path where your website export ZIP archive will be written to. Make a note of the location to easily find the file after export completes.
  • Browse – This button will allow you to specify a different location for the website export ZIP archive. Click the button to select a new folder location.
  • Customize scrubbing options – Use this check box to define custom scrubbing options or leave it unchecked to accept recommended settings.

You can prepare your development website for deployment on a live server by defining your real registered domain name in the Site Name field. This will prepare all your files, including your database export file with the correct real domain using the ‘scrubbing’ process. Click next to prepare your website ZIP archive.

About the Scrubbing Process

Scrubbing is the act of analyzing your website files and the MySQL database for references to your website’s domain name. During the process of creating your development website, you may have made references to your domain name (i.e. www.example.dev). These references might exist inside the edits you have made to the PHP files that make up your site’s template, or within the body of content that make up your posts and pages inside the database. Various plugins and configuration settings may also reference your development domain name. Scrubbing will replace these old references with new references to the real site name you intend to use for live deployment. A typical WordPress developer would limit such references to the files inside the wp-contents folder, and leave all other files (aka WordPress ‘core’ files) untouched. A WordPress pro wouldn’t even reference the domain name at all, but instead use WordPress template tags (such as <?php bloginfo(‘url’); ?> ) or isolate such references to only be inside database post content.

Unfortunately, it is not an easy task to update references inside the MySQL database as data is usually formatted (serialized) in a way that a traditional search and replace would break the database. Even dumping the data to a text file and re-importing the data after a search and replace would prove unsuccessful. This is because WordPress, plugins, and themes may store data in formats that would become corrupted when edited by hand. DesktopServer takes a more advanced approach by scanning files and all of your database tables (even ones that third-party plugins create) to correct for these issues. To accelerate the process, DesktopServer gives you additional options to omit tables and files that don’t need to be scrubbed. You may access scrubbing options by selecting the ‘Customize scrubbing options’ check box when importing or exporting to and from DesktopServer. The default will list the database tables and common files and folders to omit. In most cases, you can just use the default.

The ZIP archive will contain all of your website’s files which will include the following:

  • All WordPress core files including the wp-config.php with the database credentials you specified (if any) for your live hosting provider.
  • All of your wp-content folder and files, including plugins, themes, uploaded content, etc.
  • A database dump of all your database tables for WordPress, inside a file called ‘database.sql’ which includes any tables that third-party plugins may have created.

Deploying your website to a live server would require manual installation or using our new beta feature, “Quick Deploy”. Manual installation entails copying the contents of the ZIP package to your live web server and executing the contents of the database.sql on your live MySQL database. The database.sql file can be executed using phpMyAdmin’s Import feature into your live database or via the MySQL command line tool if you have shell access to your hosting provider account. It should be noted that the database.sql file will erase any existing WordPress database.

The Import Feature

Importing will allow you to create a new DesktopServer website from an existing website archive. The feature will import from other DesktopServer export archives and is also compatible with the free Duplicator plugin that is available in the WordPress.org plugin directory. This will allow you to transport your work between DesktopServers or from a live website to DesktopServer by using Duplicator to import a live website.

To get started using the import feature, select the “Export or import a website” option and click next, followed by the “Import an existing WordPress website archive” option and click next. You will be presented with a number of fields as defined below:

  • Import File – Provide the ZIP archive file produced from a previous DesktopServer export or from the Duplicator plugin. Click the empty field or the ‘…’ button to display the file open dialog box to select the ZIP archive.
  • Site Name – Specify a site name to refer to your DesktopServer website. DesktopServer will replace the top-level domain name with the fictitious .dev (dot DEV) domain to ensure you are accessing a localhost website.
  • Site Root – This is a read-only field that indicates the location to place your WordPress website files for your newly imported website.
  • Browse – Use the browse button to specify a different Site Root to store your website files. Click the button to display a folder selection dialog window.
  • Customize scrubbing options – Use this check box to define custom scrubbing options or leave it unchecked to accept recommended settings.

You can select the ZIP file you want to import as a new WordPress website by simply clicking the first field (Import File). Once you select a ZIP file, DesktopServer will attempt to validate the file format. You can customize the domain name by altering the Site Name field. For security purposes DesktopServer will change the top-level domain to .dev (dot DEV). Clicking the next button will start the import process and your new website URL will be presented to you on the last screen.

Limitations

Limitations vary based on your hardware specifications (amount of memory, processor speed to perform scrubbing, etc.), there are some innate limitations to the technology at this time. Heavy video and Multisite users will want to note that file sizes above 4 gigs and total number of files exceeding 65000 individual files will break the standard ZIP file format. Import and export features use the standard ZIP file format and it would be safe to say that import and export sizes exceeding this are not supported. Although we have yet to test the upper bounds of import and export, here are some key tips that can help make import/export with very large sites as smooth as possible.

  • Use the default setting to purge post and page revisions when exporting.
  • Eliminate any unused plugins or themes that you are not using.
  • Delete any unused content (pictures, video, etc.)

The bulk of most WordPress websites come from uploaded content such as pictures and video. If file size is a major concern, you may wish to temporarily move your wp-content/uploads folder or wp-content/blogs.dir folder (for Multisite websites) out of your website during the export process. You can always move it back or transport the contents independently to deploy your site on a live server. Media content usually does not require a scrubbing process for a successful transfer.

Conclusion

With DesktopServer’s new import and export features, you can easily transfer your website creations to other DesktopServer users. You can also import existing websites from a live host, or deploy your work to a live host. For more information about how to deploy live, check out my post titled Using Quick Deploy on a Live Server. If you wish to capture your current live website, check into my post titled Using Duplicator to Import a Live Website. Now with import/export, you can share your WordPress creations and solutions, complete with their configurations easily.

Tagged , ,
About Stephen Carnam
I’m a San Diego, California based computer programmer and graphic designer that has been consulting, developing, and maintaining web & software applications for well over ten years. My languages and interests include PHP, Java, JavaScript, 3D rendering/sculpting, and snow boarding.

22 Comments

  1. catamundo says:

    Hi Stephen,

    Although the import process went smoothly (thanks for a great tool!), I’m running into a problem. The absolute URLs from the live site remain throughout the local version, so that every internal link brings me back to the live site.

    I know there’s a hack I could make to re-write the internal link URLs, but it would be great if this would happen during the ServerPress import. Am I missing something?

    In case the URL re-writes are supposed to happen during the Duplicator packaging process, I tried fiddling around with its settings. I tried making the ‘install URL’ in Duplicator settings match the final destination on my local drive (Mac), e.g. “http://www.mysite.dev” and “http://localhost/www.mysite.dev”, also leaving it blank– no change.

    I also tried importing the Duplicator package with ServerPress to various places on my local drive– I tried putting it into the two ‘standard’ places, i.e., Applications/XAMPP/htdocs/ and ~username/Sites/ –no change.

    Any help would be much appreciated! Thanks again for a great, much-needed tool, and I really appreciate your obviously very active work to get it right!

    1. Stephen Carroll says:

      Hi Catamundo, that should definitely not be happening. The scrubbing process is apart of the import and is actually more inclusive then similar products. It scrubs (replaces) not just references in posts and pages, but also plugin generated tables, PHP, XML, and html files. That’s very agressive! But you can turn a lot of these features off using the ‘advanced scrubbing’ options. Check your siteurl in WordPress’ settings, general. You may wish to extract the database.sql file from the ZIP duplicator generated one and send it to us if the problem persists. We’d look at the original domain. DesktopServer should have picked it up from your siteurl and replaced it on the fly with the .dev equivalent.

  2. marina says:

    Hi Stephen,

    Duplicator doesn’t create links in admin interface. I get ZIP files but no install.php files in folder, and no links in admin interface is visible.

    Copy UPDATE path premium Desktopserver to my existing Limited version.

    Import ZIP file ( my live website )

    Get ERROR:

    Not exist : bardotbrdbr77fg.wp_options
    ( ??? have No such )

    and
    ERROR:
    an exeption of class NilObjectException was not handled

    Please help,

    Marina

    1. Stephen Carroll says:

      Hi Marina,
      I’m sorry to hear that you are having issues with Duplicator. Although we aren’t the authors, I’ll try my best to help resolve this issue. This maybe related to duplicator and your live site’s version of MySQL. Initially, I’d suspect a possible permissions issue on some of your websites files but I’ll need more information. For additional support, please post in our forum and be sure to include your platform (Windows XP, Vista, 7, MacOS Tiger, Leopard, Snow Leopard, Lion, etc). Also, please let us know what WP version (3.3?).

      Regards,
      Stephen

  3. laurel says:

    This may seem a silly question but I have built three different websites on desktop server, I am now looking to publish one of them but am unable to export etc as do not have ‘Export or Import a website’ button, please can you help, many thanks Laurel

    1. Stephen Carroll says:

      Hi Laurel!
         Not a silly question. It sounds like you are running DesktopServer Limited. Import and Export is only available in DesktopServer Premium edition. 

      Regards,
      Stephen 

    2. laurel says:

      Hi Stephen, Thanks for your reply but I have definitely got ‘Premium’ membership, this was set-up on 8th May 2012, is there something that I have done wrong with the set-up as I am pretty sure that I downloaded the Premium version, many thanks Laurel

      1. Stephen Carroll says:

        Hi Laurel,
        Please take a moment to look at the title bar of the DesktopServer window. Does it say “DesktopServer Premium” or “DesktopServer Limited”?

  4. laurel says:

    Hi Stephen, you’re correct, it says DesktopServer Limited, how has this happened, I’ll double check that the payment definitely went through with PayPal, what shall I do next? Many thanks again Laurel

    1. Stephen Carroll says:

      Hello Laurel,
      Apologies for the confusion. Please login and visit the downloads page at http://serverpress.com/downloads/. The “BUY” links should be replaced with real links for the duration of your license (1 year). Simply download and unzip the package followed by running the installer. Please see:

      http://serverpress.com/news/how-to-install-desktopserver/

      For additional support, please post your OS version (Windows 7, Mac 10.7.4, etc.) in our forum at:

      http://serverpress.com/forums

      Thank you!

  5. laurel says:

    That’s great Stephen, just one more question, will this effect the work (websites) that I have already built? Many thanks again Laurel

    1. Stephen Carroll says:

      No. The installer should default to “upgrade or update”. Please *do not* use the Uninstall option. Don’t hesitate to contact us in the forum, email or phone if you have any issues. :-)

  6. laurel says:

    All done, many thanks Laurel

  7. dobie says:

    Trying to create a local site from an existing site, but run into problem. Firstly, I have a minimum backup in a zip and I also backup the sql database named database.sql. I then downloaded both files to a temporary folder and started the import process. However, it kept complaining no database file could be found. Where should I keep both files and are the name important?

    1. Stephen Carroll says:

      The ZIP file that DesktopServer expects should contain all of your Website’s files and folders that make up WordPress, including it’s themes, plugins and uploads. The database.sql file is generally located in the site root, next to the site root’s main index.php file.

  8. pacomelo says:

    Hello Stephen,

    I am trying to import a non WordPress site (still php/mysql/apache) to work on it in Dreamweaver. I had already managed to do this with MAMP (which is now gone) but now with ServerPress after importing the database and files to my local server I don’t manage ServerPress to recognize the site. When I check the localhost directory through the browser I the site in question is not listed (even though the files are in the localhost folder for sure). Any ideas?

    1. Stephen Carroll says:

      DesktopServer’s import, export, deploy and copy features are only designed to work with WordPress websites. However, you can create a non-WordPress website by using the “Blank (non-WordPress)” blueprint from the drop down combo box. This will still generate a Dreamweaver project file that you can use to open your non-WordPress website in Dreamweaver.

  9. Priscilla says:

    OMG! Using Duplicator to import my live site to DS was so easy! I did have a bit of an issue the first time but I created a filter to eliminate some large files in my uploads and was shocked when it simply loaded into my browser. I didn’t even need to add the db name or anything. Which is almost scary. BOO! Hey, its October—THANKS!

  10. markandphil says:

    It worked but I’m not sure HOW. I downloaded a snapshot from WPEngine and then imported the zip file. It imported and is working wonderfully. But how? I noticed in the original zip file the wp-config.php is saying the database is at 127.0.0.1 (home) but how are you able to connect to it and actually import in the tables without a real IP or URL?

    Feel free to tell us the truth or feel free to respond that “it’s just MAGIC”. Either way, this is absolutely fantastic software!

    1. Hi!

      DesktopServer actually creates local host entries and then scrubs your database to reflect those host entries which is the “secret sauce.” Of course, “it’s just MAGIC” works for us as well! :)

  11. lholiner says:

    Does the Export export media and data created in custom posts? When I tried doing this directly from WordPress, I didn’t get either.

    1. Stephen Carnam says:

      DesktopServer exports everything to a .zip archive. The .zip archive contains your entire WordPress website, media, posts, pages, CPT, uploads, database… everything. :-)

Leave a Reply

You must be logged in to post a comment.