Introduction
This tutorial explains how to seamlessly migrate domains, websites, mails and databases from a different product or another provider to a Hetzner web hosting package, while keeping everything reachable and usable.
Step 1 - Domain Transfer
To transfer your domain from a different provider to a Hetzner Webspace, please follow these steps:
- Get an authorization code ("Auth Code" or EPP) from your current domain or web hosting provider's administration interface. Alternatively, request it from the provider via mail. It will be in the format
AAAA-BBBB-CCCC-DDDD
. - Disable the domain transfer protection and domain privacy (often called Whois privacy) on the old provider's side.
- Ensure that the admin contact information for the domain is up to date (needs to equal the data, you will submit for your new Hetzner konsoleH account).
- Cancel your account/product with your current provider and include the statement:
This domain is being transferred to another provider
. Pay attention to the cancellation date, as you need to finish the migration before. Alternatively, you can also keep the account, or just cancel it after the migration. - Select one of our web hosting accounts from our website. If you are a new customer, you will create an account for our administration interface, which is called konsoleH.
- While ordering the web hosting account and choosing your domain in step 2, please enter the auth code into the correct field. If you do not yet have the auth code from your old provider, you can send Hetzner the auth code later in a support request.
While your konsoleH account is activated instantly, the domain transfer usually takes 5-7 work days, depending on the TLD (top-level domain). Meanwhile, your domain will still point to your old server or webspace. You can find further information here.
Step 2 - Website Migration
In order to download your website from your current webspace or server and then upload it to your new Hetzner web hosting, you need a file transfer software, that supports FTP(S). I therefore recommend using FileZilla.
Step 2.1 - Download your website content from the current web server
Please enter the FTP login details of your current web server to your FTP software. If you have a webspace, you will most likely find the required credentials at the provider's administration interface.
Once connected, you should see all files on your current webspace. Select and download them to your PC.
When using FileZilla, you can achieve that by following these steps:
- On the left side of the program, please navigate to the preferred download path.
- Again on the left side, perform a right click in the empty area of the file list, choose
Create directory
and give it a name. Now navigate into this folder. - Click on any file in the file list on the right side.
- Then press
Ctrl
+A
to mark all files and folders, make a right click on the selected files and chooseDownload
. This will create a full copy of all your website files into the folder, you have chosen on the left side.
Step 2.2 - Upload your website content to your new web server
Now you need to enter the FTP login details from your new Hetzner web hosting instead. You can find them in the konsoleH. In the upper menu bar, select Products
. Then, navigate to Services
in the left menu bar and select Access details
🡲 Login data
. There, you can find the section FTP Login
.
Once connected, you will see that your new webspace already contains some files and folders. Please navigate to the folder public_html
and upload your website files there. Please pay attention to what you are uploading - all files in this directory will be publicly available via your domain.
When using FileZilla, you can achieve that by following these steps:
- On the left side of the program, please navigate to the folder, containing the previously downloaded files.
- On the right side, enter the directory
public_html
by double clicking on it. - Now click on any file in the file list on the left side.
- Then press
Ctrl
+A
to mark all files and folders, make a right click and chooseUpload
.
Step 3 - Mail Migration
Your mail accounts can either be created individually and then populated with the mails from the old account, or you can send in a CSV file via support request, which allows your accounts to be created and imported automatically (recommended if you have many accounts).
Option 1 - Individual Import
In order to download all mail accounts from your current provider and then upload them to your new Hetzner web hosting, you need a mail software that is capable of handling multiple accounts and allows to copy mails between them. I therefore recommend using Thunderbird and will explain the procedure using this software hereafter.
For each mail account to migrate (XXX
@example.com), please repeat the following steps.
-
Add the new mail account
Access the konsoleH and choose
Email
->Mailboxes
from the menu on the left. Then clickNew mailbox
and fill out the form. The value inMailbox name
needs to be equal to the name of your current mail account. After clickingSave
, your new mail login credentials are displayed, which are required in the next step.
-
Connect your mail client to both accounts
- In Thunderbird , please click on the menu button (small square with 3 horizontal lines), which you can find in the top right corner.
- There, please click on
Account Settings
. - Please now click on
Account Actions
on the left side and chooseAdd Mail Account
. - Enter the mail address and password of the current mail account to migrate and click on
Continue
. If Thunderbird could not determine the mail server addresses, please manually enter them. You can often find them by googling formailProviderXY imap
(replace "mailProviderXY" with the name of your old provider). - Once the account has been successfully added, please navigate back to
Account Settings
. On the left side, please click on the new account and change the value in the fieldAccount Name
to something likeold
.
Please repeat those steps to add your new mail account - but this time, please click on
Configure manually
after you entered the mail address and password. In the manual configuration form, you need to fill inmail.your-server.de
as hostname for both the incoming and outgoing server. After you have added the account, please rename it to something likenew
.Back in the normal mail view of Thunderbird, you should now see two accounts in the list on the left side -
old
andnew
. It is now recommended to one by one click on all folders under the accountold
. This will cause Thunderbird to download the mails in those folders.
-
Upload all mails to the new mail server
Before continuing, please wait for the mail software to finish downloading all mails. With Thunderbird, this information is shown on the bar at the bottom of the window. If this bar is empty, Thunderbird is idling and you can continue.
Please repeat the following steps for all folders below your current mail account (
old
):- Click on a folder in the list on the left side (e.g.
Drafts
). - Now check the bar at the bottom of the window. If it indicates a running mail download, wait for it to finish.
- Click on any mail and then press
Ctrl
+A
in order to select all mails in this folder. - Right-click on the selected mails.
- Select
Copy To
->new
->Inbox
->TargetFolderWithSameOrEqualName
(e.g.Drafts
orTemplates
).
If there is no equal folder present at the target account, you can create one by doing a right click on
Inbox
under the accountnew
and choosingNew Folder
. This is specifically required for folders, other than the default ones, like Inbox, Drafts, Sent and Trash.Once you have copied over all mails from all folders under your current account (don't forget
Inbox
), it is recommended to compare all folders, so you can ensure that nothing gets lost when cancelling the old account. Therefore, just click on the regarding folders and you will get the amount of mails in this folder displayed in the bottom right corner. - Click on a folder in the list on the left side (e.g.
Option 2 - CSV Import
For the automatic import via support request, please create a CSV file with the following structure:
domain
;mail address
;type
;password
;copy/forwarding addresses
;IMAP server
;IMAP username
;IMAP password
value | explanation |
---|---|
domain | The domain for which the mailbox should be created. This domain must also be created in konsoleH as account or addon domain. |
mail address | This is the part before the @ sign. |
type | Whether a mailbox or a forwarding should be created: MAILBOX or ALIAS . |
password | The password for the mailbox - if the field is empty you can set the password in konsoleH after the import. Please follow the password guidelines: The password must be at least 8 characters long and contain the following characters: |
copy/forwarding addresses (optional) | Here you can enter mail addresses that will receive a copy of incoming e-mails (enter multiple addresses comma-separated if necessary). |
IMAP server (optional) | The remote IMAP server from which the mails should be fetched initially. |
IMAP username (optional) | The IMAP username for this (often the corresponding old mail address). |
IMAP password (optional) | The IMAP password to this remote account. |
Then send the CSV file via a support request from konsoleH. Please note that very extensive imports will be charged with a fee of 17,65 Euro (excl. VAT) per started quarter hour.
Step 4 - Database Migration
If you have any databases in your old web hosting, you can export and re-import them into your new Hetzner database platform.
For this, please login to konsoleH. In the upper menu bar, select Products
. Then, navigate to Services
in the left menu bar and select Databases
🡲 MariaDB/MySQL
or PostgreSQL
(depending on your current database system). Then click Add
and create a database with the same name, as the database you would like to transfer.
It is also recommended to stop all applications during the migration, that have access to the database, in order to avoid changes to the old database after the data has been dumped.
MariaDB/MySQL
Export MariaDB/MySQL database
If you have access to the database administration interface phpMyAdmin (e.g. via your old provider), you can simply click on Export
in the navigation bar and then hit Go
.
Alternatively, use the mysql
and mysqldump
command line tools.
You can install them as follows:
-
Windows:
-
Download and install the MySQL Workbench.
-
Go to the installation folder and copy its path.
-
You can then use the named tools in the CMD by appending them to this path, e.g.:
C:\Program Files\MySQL Workbench XY\mysql.exe
C:\Program Files\MySQL Workbench XY\mysqldump.exe
-
-
Ubuntu/Debian:
apt install mysql-client
-
CentOS/RHEL/Fedora:
yum install mysql
OR
dnf install mysql
-
MacOS:
brew install mysql
Now you can create a dump of the whole database like so:
mysqldump -h old-database-host.com -u username -p database-name > dump.sql
or for Windows (search for CMD
in the start menu):
"C:\Program Files\MySQL Workbench XY\mysqldump.exe" -h old-database-host.com -u username -p database-name > dump.sql
Import MariaDB/MySQL database
As the konsoleH offers the database administration interface phpMyAdmin (click on the pencil behind the regarding database), you can simply click on Import
in the navigation bar, select the dumped file and then hit Go
.
Else, to re-import the database to your fresh Hetzner database host, just execute this command with the new credentials, displayed in the konsoleH:
mysql -h sqlXXX.your-server.de -u username -p databasename < dump.sql
or for Windows:
"C:\Program Files\MySQL Workbench XY\mysql.exe" -h sqlXXX.your-server.de -u username -p databasename < dump.sql
PostgreSQL
Export PostgreSQL database
If you have access to the database administration interface phpPgAdmin (e.g. via your old provider), you can simply click on Export
in the navigation bar and then hit Go
.
Alternatively, use the pg_dump
and pg_restore
command line tools for the migration.
You can install them as follows:
-
Windows:
-
Download and install PostgreSQL. In the installer step
Select Components
, you only need to selectCommand Line Tools
. -
Go to the installation folder and copy its path.
-
You can then use the named tools in the CMD by appending them to this path, e.g.:
C:\Program Files\PostgreSQL\XY\bin\pg_dump.exe
C:\Program Files\PostgreSQL\XY\bin\pg_restore.exe
-
-
Ubuntu/Debian:
apt install postgresql-client
-
CentOS/RHEL/Fedora:
yum install postgresql
OR
dnf install postgresql
-
MacOS:
brew install libpq
Now you can create a dump of the whole database like so:
pg_dump -d 'postgres://username:password@old-database-host.com:5432/database-name' -Fd -j 5 -f dump_directory
or for Windows (search for CMD
in the start menu):
"C:\Program Files\PostgreSQL\XY\bin\pg_dump.exe" -d 'postgres://username:password@old-database-host.com:5432/database-name' -Fd -j 5 -f dump_directory
Import PostgreSQL database
If you have the database administration interface phpPgAdmin installed (the konsoleH does not offer it for PostgreSQL, but you can use your own installation), you can simply click on Import
in the navigation bar, select the dumped file and then hit Go
.
Else, to re-import the database to your fresh Hetzner database host, just execute this command with the credentials, displayed in the konsoleH:
pg_restore --no-acl --no-owner -d 'postgres://username:password@sqlXXX.your-server.de:5432/database-name' --data-only -Fd -j5 dump_directory
or for Windows:
"C:\Program Files\PostgreSQL\XY\bin\pg_restore.exe" --no-acl --no-owner -d 'postgres://username:password@sqlXXX.your-server.de:5432/database-name' --data-only -Fd -j5 dump_directory
Once the new database is set up and fed with the data from the old one, you can now proceed changing the connection details in your applications to the new database and start them again.
Finalization
After you have migrated all data to your new web hosting, it is now time to let your domain point to it. Of course, you can also wait for the domain transfer to be finished, but this may lead to differences between your duplicated data (e.g. new mails will arrive in the old mailbox, which would then require another sync to the new one).
Therefore, just login to your old domain provider's administration interface, go to the DNS management section and change the authoritative name servers to the Hetzner/konsoleH ones. If you have subdomains or other additional DNS records, it is now a good time to take them over from your old provider's interface to the konsoleH (Services
🡲 Settings
🡲 DNS Administration
).
After up to 48 hours, your domain will resolve to your new website and new mails will appear in the Hetzner mail account.