Jump to content
Violet

[SOLVED] Which of these 3 options is best when migrating to another domain name?

Recommended Posts

Posted (edited)

In this case, I have a live Processwire site which I'd like to migrate to another domain name. I have come up with 3 possible approaches, and would like to please know which you think is best suited to my situation.

Here are 3 factors to take into account:

  • I have phpMyAdmin on both the old and the new domains, in case this helps.
  • On the new domain I want to use Softaculous to do the initial Processwire install. This is for reasons other than ease of install (although it certainly makes for a fast install).
  • I am not at all confident with SQL and would rather avoid it if at all possible.

Option 1: Manual.

Export field contents (e.g. title, body, etc) from current domain database into CSV format using phpMyAdmin.

Install PW in new domain with Softaculous.

Then in new domain, copy over the template files, and from PW admin screen of old domain export the fields and templates, save these details for import in the new domain.

Copy over image files into assets folder of new domain.

Create new pages manually and fill in field contents in new domain in admin office by copy-and-pasting from my CSV files.

🙄 This is likely to work really well, but seems time-consuming. Anything that can give the same result but uses less time would be a big improvement.

Option 2: Duplicator

Use the Duplicator module ( https://modules.processwire.com/modules/duplicator/) - but I'm not sure if it's designed for use when moving to a different domain name (as opposed to just migrating same domain to a different host).

Option 3: Site Profile Exporter

Use Site Profile Exporter ( https://modules.processwire.com/modules/process-export-profile/) - but it's designed for use as a version of the site that you can share with others with no confidential data, while I need a regular full site.

 Hmmm....

Does anyone have any ideas which of the above options is best? Or is there a better approach that I have not considered?

Edited by Violet
marked as solved

Share this post


Link to post
Share on other sites

Advocating for option 1, if you have phpMyAdmin on both servers you could rather do a simple SQL export/import, then you skip all of what you mention about exporting fields, templates, etc. (I guess create the database/db user first from whatever management panel you are using)

Also, instead of installing through softaculous, you could just zip, upload an unzip the whole ProcessWire website inside the web root of the new server (public_html folder in some servers,  for example). If you reconnect the db with the new database data in config.php, it should just work. And last but not least, change $config->httpHosts array in config.php to accept the new domain. 

Also I guess Duplicator should work, would try with it first if you don't feel very confident in the above steps. 

  • Like 1

Share this post


Link to post
Share on other sites
4 hours ago, Violet said:
  • I have phpMyAdmin on both the old and the new domains, in case this helps.
 

Every time I see a mention of phpMyAdmin, I have to suggest Adminer https://www.adminer.org/

It is a single page PHP file that totally replaces the need for phpMyAdmin. I have used it for years. The English only version is just 205kB.

Just download, rename to index.php and upload to a new directory in your website www.yoursite.com/db and there ya go, instant access 😄 

  • Like 4

Share this post


Link to post
Share on other sites

You didn't mention the size of your website while that plays an important role e.g. time outs in the mentioned plugins. Roughly speaking if your site folder is more than a Gb, you should go for manual. I also recommend scanning your database for mixed content pointing to your old domain name.

  • Like 2

Share this post


Link to post
Share on other sites

@Violet With "migrate  to another domain name" you mean another server, right?

If so, I also recommend copying the database via adminer or PHPMyAdmin.
For copying the files, use rsync over SSH (because of direct connection between old and new server and use of compression).
If you don't have access to SSH I recommend downloading all the files via FTP and upload them on the new server also via FTP.

  • Like 2

Share this post


Link to post
Share on other sites

Clear vote for Duplicator from my side, since its a no-brainer. You still may copy a very large (GBytes) /site/files folder manually, if required.

Btw: Allowed domains are configured in your site/config.php ($config->httpHosts). If you go with the manual approach, you'll have to adjust this manually as already stated, otherwise Duplicator does this for you.

  • Like 2

Share this post


Link to post
Share on other sites
5 hours ago, Violet said:

Or is there a better approach that I have not considered?

You don't need to migrate to a new hosting server just because the domain name for a site changes. Point the domain to your host and update $config->httpHosts in /site/config.php. Depending on the type of hosting you might need to adjust a setting there too, e.g. update the primary domain if it's a cPanel host.

  • Like 5
  • Thanks 1

Share this post


Link to post
Share on other sites

Wow! I'm blown away by receiving so much help here, and it's very much appreciated and needed! Thank you. I will be reading all the answers again carefully, but I thought I'd also post here answers to 2 questions that came up.

5 hours ago, pwired said:

You didn't mention the size of your website while that plays an important role e.g. time outs in the mentioned plugins.

Great point. This is a small site, more than a landing page but less than my other sites. It's maybe 15 - 20 pages on the front-facing side (that is, excluding admin pages etc etc). I plan to add more to it later, but for now it's fairly small. It's a simple site in terms of not needing other software packages etc - it's just straight processwire.

3 hours ago, jens.martsch said:

With "migrate  to another domain name" you mean another server, right?

Actually no, I'd be on the same server. Sorry, I should have mentioned that, I didn't realize that would make a difference.  This is my first time migrating ANY site to a new domain. I do have several other sites running on that same host though, in case that affects anything.

Share this post


Link to post
Share on other sites
22 minutes ago, Violet said:

I'd be on the same server.

So just edit site/config.php and add the new domain to the $config->httpHosts array. "migration" done.

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites
58 minutes ago, Violet said:

Actually no, I'd be on the same server

What @Autofahrn said is correct in this case. No need to transfer anything. Just change the domain name and enter it in the config.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

The final verdict is in!

Thanks to everyone, I have moved the site to the new domain (actually it's duplicated but that's OK since I can erase the old one). When I started to act on the recommendations, I sort of accidentally discovered a 4th option (explained below) which worked. But I wish I'd done it the way suggested by @Robin S, @Autofahrn and @jens.martsch (updating $config->httpHosts in site/config.php). I'm sure that would have been even faster.

So anyone else who comes across this thread looking to do the same sort of thing (moving site to new domain on same host), you might like to try that solution of  $config->httpHosts in site/config .

What I wound up doing

However, I had not yet read those 2 latest responses at the time, so I was thinking about all the different methods and was looking to try the Duplicator module. Desiring to be a responsible site owner, I went to create a Softaculous backup of my site before trying the Duplicator module. This way I can restore my original site in 1 click if I do anything wrong. To my happy surprise, in the backup menu in Softaculous, one of the other options besides back up was "Clone site". Well, being curious, I thought "Let's try that, and if it doesn't work out, I can use one of the other methods people suggested". So, I tried Clone Site, and it worked perfectly! I just had to do point and click and tell it which of my domains to put the cloned copy of the site in, and boom, there it is at the new domain! After doing that, I then read the newest responses to my thread and realized that it would have been even faster to use the solution of Robin S, Autofarn and jens.martsch, but anyhow, the Softaculous method works too in case anyone has it available to them and was wondering about it.

And after the site is in the new domain...

A big thank-you to pwired for the advice given

10 hours ago, pwired said:

I also recommend scanning your database for mixed content pointing to your old domain name.

This turned out to be really helpful - I tried the search function in phpMyAdmin and found a few mentions of my old domain name still in there. It was clear from the results which pages I needed to edit in the processwire editor. So it may be a useful step for others too who are looking to do a similar type of domain move.

Thank you again to everyone who responded in this thread. All of the suggestions were very useful. I really appreciate the sense of community here.

  • Like 7

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...