Migrate from WordPress
Migrate from WordPress
This walkthrough moves a WordPress site into Sophia Stack X and keeps its old addresses working. The importer is described in Moving a site in. Here the steps come in order, with the checks to run before you switch your domain. Your WordPress site is never touched: the importer only reads the export file.
What comes over, and what does not
Comes over:
- Pages and posts, with dates, authors, categories and tags. Drafts and private posts arrive as drafts.
- The pictures those pages use, from a copy of
wp-content/uploadsor downloaded from the old site. - Menus, and the home page.
- WooCommerce products with sale prices, stock, galleries and variations (variations become product options).
- Approved comments with their replies. Spam and pingbacks are skipped.
Does not come over:
- Plugin shortcodes. The importer removes them and lists them in its report, so you can rebuild what they did with blocks or an extension.
- Custom post types made by plugins.
- Your WordPress theme. You pick a Sophia Stack X template and set colors and fonts on the Design screen.
- Plugin settings and plugin data such as form entries.
Check the list against your site first. If a plugin does something important, such as a booking form, look for the matching built-in app (bookings, forms, newsletter, shop) before you start.
Steps
1. Get Sophia Stack X running. Install it on your computer. Do the first run on your own computer, not on the live server, so a mistake costs nothing.
2. Export from WordPress. In WordPress, open Tools, then Export, choose All content, and download the .xml file. For WooCommerce, the same export includes products.
3. Copy the pictures (best), or let the importer fetch them. Copy the wp-content/uploads folder from your host to your computer and pass it with --uploads. If you cannot, use --download and the importer fetches the pictures from the old site.
4. Do a dry run. It lists what is in the file and writes nothing:
sophia import export.xml --as my-site --name "My site" --dry-run
5. Import for real into a new site:
sophia import export.xml --as my-site --name "My site" --uploads ./uploads --hosts example.com,www.example.com
You can also use Import in the admin or have an agent call the import_site tool. Importing again updates what it brought in instead of making copies, so you can fix and re-run. To import into a site that already exists, use --into <site> in place of --as. That keeps the site's own home page and blog list, unless you add --set-home.
6. Read the report. It lists removed shortcodes and anything skipped. Open the site in the admin and look at the home page, a post with pictures, a menu, and a product if you have a shop.
7. Pick a template and publish. Choose a template under Settings, set the look on the Design screen, then publish. Publishing checks links, picture descriptions and leftover placeholder text before it goes live.
Check the redirects before you switch
Every old WordPress address answers with a 301 redirect to its new page, and links inside the text are repointed. 301 is the permanent redirect search engines follow to carry rankings across. Check it yourself, do not trust it:
- In WordPress, make a list of your most important addresses: the home page, your ten top posts, your product pages and any page people link to.
- Run the new site on a test address and request each old path, for example
curl -I -H "Host: example.com" http://127.0.0.1:8806/2023/05/old-post/, with your site's domain as the host. A good answer is a301with alocationheader pointing at the new page, and the new page then answers200. - Fix any miss. A page that was not imported, or an address a plugin made, will not redirect. Recreate that page at the same address (a menu item gives a page its address) and publish again. See Publishing.
Switch your domain
- Deploy to a server (or use the one-command installer on the Install page) with your domain, and send the new site there.
- Turn the site's public address on under Settings so the sitemap and canonical links use your real domain. Look at the SEO audit.
- Point your domain's DNS at the new server. Keep the old WordPress hosting running for a few days, so you can go back if needed.
- Take a backup (
sophia backup) once the site is live, and again after any big change. See Security and backups. - If you use Google Search Console, submit the new sitemap and watch for crawl errors on old addresses.
If something goes wrong
Nothing here touches your WordPress site until you change DNS. Before that, a bad import costs you a delete. After the switch, every publish is a numbered release, so the last ten versions go back live in one click, and the old hosting is still there until you cancel it.
Next
- Moving a site in: the importer for Joomla and Markdown too
- Compare: where WordPress is the better choice
- Try the live demo before you move anything