Migrate an existing Craft 3 website to Hyperlane

Video tutorial

The guys over at craftquest.io have created a full course on Craft hosting with Hyperlane. Follow step 7 of this course on how to move an existing Craft website over to Hyperlane. In just over five minutes they show every step on how to achieve this. A step-by-step guide is available below.

Step-by-Step guide

  1. Create a new project and choose 'Craft 3' as application type. Make sure to add the base install to your Hyperlane Git.

    Note

    Before moving on to step 2, your Hyperlane Gitlab account must have been set up. See how to setup your account right here.

  2. Clone the repository to your local environment.

    1. Open the project in Hyperlane and go to the 'Info' tab of the Development environment.
    2. Copy the Git repository URL to your clipboard.
    3. Clone it somewhere on your local filesystem (e.g. ~/development).
    4. git clone https://git.hyperlane.co/personal/john-doe/awesome-project.git
  3. Copy the files from your current site to the cloned Git directory.

    1. Remove everything from this directory, except the .git directory and the .gitignore file. (update the .gitignore file if necessary)
    2. Add all the files from your existing site, except the .git directory and the .gitignore file.
    3. When you are working asset sources (see configure asset sources for Craft 3), you must include the Hyperlane defined aliases in the config file. Screenshot

    Note

    Do not add your assets (images, files, uploads, ...) to the repository! If you want to make full advantage of the Hyperlane development flow, you should make sure your assets do not reside in Git, but are stored in the content volume of your project on Hyperlane. See step 6 of this guide how to achieve this.

  4. Commit and push all changes.

    1. git add .
    2. git commit -m 'Add all files of my awesome site.'
    3. git push origin master
  5. Import the database via PhpMyAdmin.

    1. Create a database dump of your current site. This can be done in the Craft admin panel or any database tool.
    2. Open the project in Hyperlane and go to the 'Info' tab of the Development environment.
    3. Copy the database username and password and open PhpMyAdmin.
    4. Import the database dump created in step 5.a.

    Note

    Before moving on to step 6, your SSH key must be added to your account. See how to get access via SFTP right here.

  6. Upload all the assets via SFTP.

    1. Open the project in Hyperlane and go to the 'Info' tab of the Development environment. Enable SFTP.
      1. Activate your SSH key when SFTP was already enabled and your key was not yet added.
    2. Connect with an SFTP client using the credentials shown in the info tab and your SSH key.
    3. Upload all files to the correct asset paths.
  7. Deploy code via Hyperlane.

  8. Visit your website!