Skip to content

Importing a WordPress Site

Introduction

You can import an existing WordPress site into a new Staatic Cloud site instead of starting with an empty installation.

The import runs against your site’s managed WordPress instance. Your current public static site is not affected until you publish a new static version.

Supported backup types are:

  • UpdraftPlus backup bundle ZIP files
  • full single-site Duplicator archive ZIP files
  • WordPress files + database (ZIP): a ZIP with your site’s wp-content folder and one database dump. A Staatic Cloud backup download as a Zip File with both the database and the files is one, so you can move a site from one Cloud site to another.

Staatic detects the type when it checks the ZIP. You don’t need to choose it.

Before you start

Before importing a backup, make sure that the following requirements are met.

  1. Create your Staatic Cloud site first by following the Getting Started guide.
  2. Wait until site provisioning has finished and your managed WordPress instance is available.
  3. Prepare a single-site WordPress backup ZIP of one of the supported types. For a ZIP of your own files and database, see Preparing a WordPress files + database ZIP.
  4. If your backup ZIP is too large for browser upload, upload it to your site over SFTP first. We recommend using /private/imports, because it keeps the backup away from web-accessible WordPress paths.

Note: Staatic creates a pre-import backup before the import starts, but the import still replaces the current files and database of the managed WordPress instance.

Preparing a WordPress files + database ZIP

If you don’t use UpdraftPlus or Duplicator, put your site’s files and its database dump in one ZIP.

The ZIP must contain:

  • the site’s wp-content folder, with at least one of plugins, themes or uploads in it
  • one database dump of the site, as a .sql or .sql.gz file

Any of these layouts works.

A Staatic Cloud backup download:

my-site.zip
|-- database.sql
`-- wordpress/
    |-- wp-config.php
    `-- wp-content/
        |-- plugins/
        |-- themes/
        `-- uploads/

Your WordPress folder zipped, with the dump next to it:

my-site.zip
|-- database.sql
|-- wp-config.php
|-- wp-admin/
|-- wp-includes/
`-- wp-content/
    |-- plugins/
    |-- themes/
    `-- uploads/

Only wp-content and the dump, which is all the import needs:

my-site.zip
|-- database.sql
`-- wp-content/
    |-- plugins/
    |-- themes/
    `-- uploads/

A few more things are fine:

  • The ZIP may wrap everything in one folder, as macOS Compress and Windows Send to > Compressed (zipped) folder do.
  • The WordPress folder may sit a few folders down, and the dump may be in a folder of its own next to it, such as sql/ or mysql/.
  • If the ZIP holds other .sql files that are not a WordPress database, Staatic ignores them and lists them in the check. If Staatic can’t tell which WordPress dump belongs to the site, it names them and asks you to keep only one.
  • If the dump holds the tables of more than one site, include the site’s wp-config.php. Staatic reads its table prefix from it. It never runs the file.

Hosting panel backups. A cPanel, DirectAdmin or Plesk backup is not a ZIP and usually holds more than one site. Unpack it on your computer. Then make a ZIP of the site’s folder (the one with wp-content in it, often public_html) together with the site’s database dump (.sql or .sql.gz, in cPanel’s mysql folder), and upload that ZIP.

Folders stored with backslashes. Some Windows tools store the folders in a ZIP with backslashes, which can’t be restored. The check tells you when that is the case. Make the ZIP again with File Explorer (Send to > Compressed (zipped) folder) or 7-Zip.

Importing your backup

Follow these steps to import your site.

  1. Go to app.staatic.com and log in with your account details.
  2. Click Account > Sites. Then click on the View Icon next to the relevant site.
  3. Click the WordPress tab.
  4. Click Import from Backup when the import prompt is shown, or choose Import WordPress Backup from the actions menu.

A Cloud site on its WordPress tab, with Import WordPress Backup chosen in the actions menu next to the run button.

  1. Choose one of the available source options.

    • Upload from computer to upload a ZIP file through your browser.
    • Choose from SFTP files to select a ZIP that is already present on the site’s filesystem. For backups uploaded over SFTP, /private/imports is the recommended location.

The WordPress import panel at its first step, Choose backup: Upload from computer or Choose from SFTP files, with the Choose ZIP button.

  1. Select your ZIP file and continue.
  2. Wait for Staatic to check the backup and detect its type.
  3. Review the detected details, the Contents section and any warnings. Contents shows the database dump that will be used, which wp-content folders are replaced and which are kept, what is left out, and any changes made to the dump.
  4. Confirm the import to restore the backup into your managed WordPress instance.

Nothing on your site changes until you confirm. If the check finds a problem, it tells you what to fix.

During the import Staatic will:

  • create a pre-import backup of the current managed WordPress instance
  • replace the current WordPress files and database with the imported site
  • change the site’s URLs to the address of your managed WordPress instance
  • validate the imported WordPress installation before marking the import as completed

What gets restored

The same rules apply to every backup type.

  • Database. The database is replaced with the one in the backup.
  • plugins, themes, uploads and mu-plugins. Each folder that is in the backup replaces the site’s folder. A folder that is not in the backup is kept as it is, and the check warns you about it.
  • Everything else in wp-content, such as languages or a plugin’s data folder, is added to the site and overwrites files with the same name.
  • WordPress core and wp-config.php are never restored. Staatic manages them, along with everything else outside wp-content.
  • Never restored either:
    • the Staatic plugins: your site keeps the ones Staatic Cloud provides
    • drop-ins such as object-cache.php, advanced-cache.php and db.php, and debug.log
    • the cache and upgrade folders
    • backup folders of backup plugins, such as updraft, ai1wm-backups and backups-dup-lite
    • symbolic links: they are skipped and listed in the check
    • macOS metadata such as __MACOSX and .DS_Store

Database dumps

Staatic removes USE and CREATE DATABASE statements from the dump, so it imports into your site’s database, and lists them in the Contents section.

A dump with triggers, views, stored procedures, functions or events can’t be imported. Export the database again without them: with mysqldump, add --skip-triggers and leave out --routines and --events; in phpMyAdmin, untick the trigger, procedure, function, event and view options.

A dump that creates user accounts, grants privileges, changes server settings or reads or writes server files can’t be imported. Export the database again without them. A dump with replication settings (GTID_PURGED or SQL_LOG_BIN) can’t be imported either: export it again with --set-gtid-purged=OFF.

If an import fails

If an import fails after it has started changing your site, Staatic restores the pre-import backup automatically. The import result then says that your site was restored to how it was before the import.

If an import fails before that point, nothing on your site was changed.

If the automatic restore can’t run, the import is marked as failed and you can restore the pre-import backup yourself from the Backups tab. See Restoring a backup.

Reviewing and publishing the imported site

After the import has completed, review the imported site in WordPress before publishing it as a static site.

  1. Click Login on the WordPress tab to access WordPress Admin. See Team Access if the user reviewing the site needs WordPress access.
  2. Review your content, theme, plugins, and site settings.
  3. Make any changes needed for your Staatic setup.
  4. Start a new Staatic publication when you are ready.

Your public static site will only change after that new publication completes.

Limitations

Keep the following limitations in mind.

  • Only ZIP files can be imported. A .tar.gz or other compressed archive, a hosting panel backup or an All-in-One WP Migration .wpress file can’t be imported as it is. Put the site’s files and database dump in a ZIP instead, as described in Preparing a WordPress files + database ZIP.
  • Browser uploads are subject to upload size limits. Larger backups should be uploaded over SFTP first.
  • The import is intended for single-site WordPress backups. Duplicator DAF archives, database-only packages, and multisite backups are not currently supported. See WordPress Multisite for how a network is set up on Staatic Cloud.
  • Completing an import does not automatically publish the imported site. You must publish a new static version yourself.
  • Even after a successful import, you should still review the imported WordPress site manually before publishing it.