Jump to content

Best way to move a Processwire site to a new server 2020?


modifiedcontent
 Share

Recommended Posts

What is currently the best way to move a Processwire site to a new server?

I have to upgrade my VPS, from CentOS 6 to CentOS 8. I have several relatively complicated Processwire websites. I am currently downloading all the files via FTP. I will export databases next.

I guess I'll use Export Site Profile. Or had that been replaced by something else? New modules that I missed?

Or will the FTP'ed files + exported database be enough? Just copy them 1-on-1 to the new server and it will all work?

What can go wrong? What are the pitfalls to watch out for?

 

Link to comment
Share on other sites

The procedure I use is:

Old Server:

  1. Download the database export.
  2. Download the site folder (you can skip cache).

New Server:

  1. Install Processwire (same version).
  2. Delete the site folder and Empty the database.
  3. Upload the site folder from the old host.
  4. Import the database from the old host.
  5. Empty cache and sessions.
  6. Update the config.php where necessary (database credentials, etc.).

Creating a site profile is not necessary.

[edit]
Since all my machines are *nix based, I use rsync to maintain duplicates:
 

rsync -azP host:source destination

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

21 hours ago, modifiedcontent said:

Or will the FTP'ed files + exported database be enough? Just copy them 1-on-1 to the new server and it will all work?

That should be enough. You just need to make sure that the server setup works, so I'd install a fresh copy of PW manually to see if that works. Then you create the db user on the new server, restore the db, copy your files and you should be up and running.

I'm not saying anything against the other 2 recommendations. Just answering your question ? 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 3 months later...

A few more points to watch out for. You need to copy the Authentication Salt in config.php to be able to use your login from the old database:

/**
 * Installer: User Authentication Salt 
 * 
 * Must be retained if you migrate your site from one server to another
 * 
 */

Installed modules and customizations can also mess up things. After simply uploading my backed-up /site folder into the new installation, I got a scary fatal server error. 

To step back I restored the /site folder of the fresh installation. I had replaced the fresh install database with my original backed-up database. That worked fine. I see all my old content and templates etc. in the admin area. 

Next I have uploaded all modules from the backed-up /site/modules to the new installation /site/modules. In the back-end I have clicked Refresh in Modules. It finds the modules and installs them. You may have to repeat Refresh a few times. 

I still keep getting this error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_headshot.filedata' in 'field list'

After uploading the rest of the backed-up /site folder, everything else seems to work fine.

  • Like 2
Link to comment
Share on other sites

  • 1 year later...

Hey @Mantas, welcome to the forum and to ProcessWire ?

2 hours ago, Mantas said:

What would be the best way to empty those?

To do so I just delete the following folders via FTP:

/site/assets/cache/*/*.*
/site/assets/sessions/*/*.*

and truncate the table "caches" in the DB.

After that you have to relogin and do a "module refresh" via  "/processwire/module/?reset=1".

That's the way I do it.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 10 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...