Move a Drupal site to Barbrick
You can move a Drupal 8 or newer site to Barbrick yourself. You export two files from your old host, a project archive and a database dump, and the control panel does the rest. This article is for site owners and developers who can run commands on the old host. If you'd rather we move it, order Expert migration.
Before you start
| Check | What you need |
|---|---|
| Plan | Business or Pro. Essential shows an upgrade option instead. |
| Drupal | Version 8 or newer, built with Composer. The project folder has a composer.json. |
| Domain | A domain or subdomain on your account with no site on it yet. Add one in Websites if you need to. |
| Old site | Leave it running until the new copy works and your domain points here. |
A site that isn't built with Composer can't use the import. Order Expert migration and we'll move it for you.
Drupal 7 sites don't move as they are, because Drupal 7 no longer gets security fixes. The import stops and Install an app shows Rebuild on Drupal 11, where you can ask for a quote.
Export the site
Take the whole Composer project, the folder with composer.json in it, not only the web folder. Leave vendor out, because we install the packages for you.
On the old host, over SSH:
cd /var/www/site
vendor/bin/drush sql:dump --gzip --result-file=../database.sql
tar czf ../site.tar.gz --exclude=vendor .
You now have site.tar.gz and database.sql.gz one folder up. The dump command adds .gz to the name.
If your old host makes backups for you, you can use those instead. Download the code, files and database backups, unpack the files backup into web/sites/default/files of the code, and archive the project again as site.tar.gz.
Upload the two files
Put both files in a folder outside public_html, such as drupal-import. Never put a database dump where a website can serve it.
- Use Files in your control panel for files up to 100 MB each.
- Use SFTP for larger files. See Connect with SSH.
You can also skip the upload and give the import two direct download links, such as backup links from your old host. Each file can be up to 100 MB, and links that expire need at least 20 minutes left.
Import the site
- Open Account → Hosting → your site → Install an app.
- Under Move a Drupal site here, click Import a Drupal site.
- Under Domain, choose the domain for the site.
- Under Your files are, choose In this account and enter the paths, such as
drupal-import/site.tar.gzanddrupal-import/database.sql.gz. Or choose At download links and paste the two links. - Click Import.
The import usually takes 10 to 20 minutes. You can leave the page while it runs. Background tasks shows its progress and tells you when the site is live.
What the import does
- Checks the archive before anything unpacks, and checks your account has room for it.
- Unpacks the project into
~/drupal, outsidepublic_html. - Creates a new database with a new password and loads your dump.
- Runs
composer installand adds Drush if the project doesn't have it. - Connects the site to the new database and secures its settings.
- Points your domain at the project's web folder.
- Runs Drupal's status report. Any error stops the import.
- Schedules Drupal cron.
If any step fails, the import removes everything it made. Your uploaded files stay where they are, so you can fix the problem and try again.
After the import
- Sign in to the new site and check your content, users and files.
- Delete the two files from
drupal-importonce the site works. The dump holds your whole database. - Point your domain here when you're ready. See After the move: a checklist.
Limits
- 100 MB per uploaded file or download link through the panel. Larger files go over SFTP.
- 2 GB unpacked and 300,000 files per archive.
- Three hours per import.
If something goes wrong
"We couldn't find a Drupal site in that archive." The archive holds only the web folder, or a folder above the project. Archive the folder that has composer.json in it.
"This site isn't built with Composer." The import needs a Composer project. Order Expert migration and we'll move it for you.
"Drupal 11 needs PHP 8.3 or newer." Move your account to a newer PHP version in Performance, then try again. See Change PHP version and extensions.
The status report found an error. The message names the problem, such as a missing PHP extension or a module that needs an update. Fix it on the old site, export again, and run the import again.
The import says there isn't enough room. The project, its packages and its database need more space than your plan has free. Delete old files or backups, or move to a larger plan.
Still stuck? Ask us and we'll walk you through it.