0

I have a Drupal 8 site on an Ubuntu 18.04 server and want to move my site to a new server with Ubuntu 20.04.

With Drupal 7 I did these steps

Create a set of keys (on the new server) :

$ sudo ssh-keygen -t rsa -b 4096 -C root@www-example-com
$ sudo cat /root/.ssh/id_rsa.pub

Add the public key (on the old server) :

$ sudo nano /root/.ssh/authorized_keys

Export the database (on the old server) :

mysqldump -u root -p www_example_com > /var/www/www-example-com/share/www-example-com_$(date +%F).sql

Repatriate the site file (on the new server) :

$ sudo scp -r -p root@xxx.xx.xxx.xx:/var/www/www-example-com/ /var/www/www-example-com/

Import the database (on the new server) :

mysql -u root -p www_example_com < /var/www/www-example-com/share/www-example-com_2020-08-10.sql

That's all, with these intructions, the Drupal 7 site works.

The problem

Now with Drupal 8 there is Composer with a new folder and file tree present in the var directories and in home.

How to move a Drupal 8 site to a new server ?

  • Rsync the files across from the old server, install composer on the new server and run `composer install` which should install all relevant packages. – baikho Aug 09 '20 at 12:19

1 Answers1

0

Install composer on your new server. Commit all your work into .git, create a .gitignore file and include the following:

/vendor/
/web/core/
/web/modules/contrib/
/web/themes/contrib/
/web/profiles/contrib/
/web/libraries/
/web/sites/*/files/

When running composer install on the new server, all the above will be downloaded by composer.

Just make sure to take a database copy from your current site and to move across the "/files" folder.

gcerni
  • 132
  • 8