Moving Drupal DDev containers / projects to a new computer

512 views Asked by At

I have several DDev containers / projects on one computer (Win 10) and I would like to move them to a different computer (Win 10). What is the best way to do that?

I tried tarballing them and copying them to the new computer where I extracted them. But, when I do DDev Start or DDev Launch it starts a whole new Drupal installation and my changes are not there.

Edit: I also ran Composer Update and it reported that there were no updates.

1

There are 1 answers

1
rfay On

The most common approach is to keep your projects under source control with git. Most people add the .ddev folder to their git project, so when they check it out, it's already completely configured. Copying the files into a tarball would be a similar approach.

You do have to move your database to the new computer though. The two easy ways to export a database are ddev export-db and ddev snapshot, both will work fine for this. If you do those into your filesystem and move it, you'll be all set.

I personally keep exports around; every project has a .tarballs folder, and I will ddev export-db --file=.tarballs/<projectname>.sql.gz to export, then on the new machine, ddev import-db --src=.tarballs/<projectname>.sql.gz

You can also easily use the snapshot feature, which just snapshots the database. ddev snapshot --name beforemove will create a database snapshot named "beforemove", which you can import on the new system with ddev import-snapshot beforemove.