Moving Wordpress from domain.tld to sub.domain.tld

Hey folks!

I have a Wordpress installed via ee on domain.tld, which works fine. It has got letsencrypt and wpfc and is working as intended.

Now I want to move it to sub.domain.tld and AFAIK there is no command for that.

I mean sure, I can simply edit the nginx config for that site and be happy, but I also want to do it “ee conform”, e.g. what else do I have to do? Moving the SQL DB? Any ee config?

I’m not sure but did you tried just to change the domain in domain host file and regenerate the letsencrypt ssl?

Or try this: Remove SSL from your website

Add new domain in host file

Visit website with new domain

Backup with updraft and then create new website with ee site create with new domain

Import with updraft

But wouldn’t that mean I get a new Wordpress site? I’d like to keep my posts and settings and so on

Just use updraft to backup and restore your website.

I just thought of 2nd method:

  • If you redirect domain2 to domain1 and change Wordpress domain from settings then you can backup and restore wordpress with domain2 using updraft.
  • Then create site using ee and restore using updraft and you will have all settings and posts as they were before.

Can you give me a link to that updraft you’re talking about? Haven’t heard it before, but going to read some docs if this is the solution :slight_smile:

I mean, I can move it on myself, too. I’m just a bit paranoid that ee may scramble up details, like when I create a new ee site create olddomain.tld, it will error me, as it thinks this still exists

Ooooh, I get it now. Thought it’s an ee function that I can’t find via duckduckgoing :smiley:

Guess you mean this plugin: https://updraftplus.com/

So my workflow should be:

  • create new sub.domain.tld site
  • backup (updraft) domain.tld
  • reimport to sub.domain.tld
  • check if it’s running -> delete domain.tld

Or am I missing something?

Download plugin from wordpress itself.

Add google drive as remote storage. Wordpress will upload backup to google drive automatically.

Your workflow is not correct because according to updraft it will be migration from domain.tld to sub.dom.tld which is not provided in free version.

Here’s what you need to do:

  1. Open your domain vhost file
  2. Add sub.domain.tld in that vhost file right after domain.tld (Example: server dom.tld www.dom.tld sub.dom.tld)
  3. Restart nginx
  4. Now try to open your website with sub.dom.tld
  5. It will open and redirect to dom.tld
  6. Now in wordpress admin panel, Goto Settings > General and change domain from dom.tld to sub.dom.tld.
  7. Now open your website with sub.dom.tld and dom.tld. You will see website at sub.dom.tld

First perform these steps then let me know. I will tell you other steps if needed.

I got it running :slight_smile:

My steps were a bit “harsh”, as my WP installation hasn’t got that much content, but it worked:

  • Backupped with Updraft
  • ee site create sub.domain.tld
  • import the shizzle
  • works? removed old site

Thanks for your help, recommending updraft has made it pretty easy!

Nice to hear that :slight_smile: