Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Installation & Hosting

What is the best way to download all site content and migrate it to a new Grav Install

Started by John French 8 years ago · 12 replies · 1630 views
8 years ago

Hello, all.

I'm building a site for a client using Grav. They'd like to see my progress as I go, so I was thinking about spinning up a dev server to post my work instead of just doing it locally.

Once it is done, however, I am wondering if there is any easy way to "package" the site and then install it in a new Grav instance on their production server?

Is there a way to do this with Grav itself? I found this plugin but I am not sure if that can install from a backup.

I hope that all makes sense. Any help would be greatly appreciated.

8 years ago

Update: I found the "Backup" button right there on the admin dashboard. Now I just need to figure out how to install from a backup.

8 years ago

@johnfrenchxyz According the docs Creating a Backup:

Backing up your project is nothing more than creating an archive of the ROOT of Grav. No Database, no complications.

You can create the backup through the admin dashboard as you mentioned or using the CLI:

BASH
cd ~/workspace/portfolio
bin/grav backup
8 years ago

That is great. Thanks, @pamtbaau

I discovered that you can also do it from the dashboard in the admin panel, but that is awesome that you can do it from the CLI.

Now I just trying to figure out how to install that backup on a new Grav instance.

8 years ago

@johnfrenchxyz FTP + Unzip?

8 years ago

I understand how to put the backup on the server. I guess I wasn't thinking about the backup as a complete instance of grav itself, but if it is then I guess that might answer my question. I was wondering if you were supposed to install a new instance of Grav first, and then do something to install the backup.

I'll try it and update this thread if it is that simple.

8 years ago

@johnfrenchxyz The zip contains a complete backup of the root of your site. Just tried it myself and it works instantly after unzipping.

You may have to consider some configuration settings that are different from your dev server:

  • Think of caching, pipelining, debugger, etc. in user/config/system.yaml.
  • How about site settings in user/config/site.yaml?
  • Does .htaccess need some tweaking?
  • Clearing /cache and /assets.
  • ...

If there is already a Grav installation, I only copy required /user/... folders and files.

👍 1
last edited 07/09/18 by pamtbaau
8 years ago

That's awesome! Thank you so much for the help!

8 years ago

I make a git repository of the user folder locally, and sync that with a remote private repo (Bitbucket has free ones, I think Gitlab do too).

I also track the remote repository on my server (test and production environments, but you could skip test). On the server, I simply git pull when I am ready to update. This could be automated even more, but I haven't bothered.

Much easier and foolproof than zip+FTP if you are comfortable setting this up. Works a treat, actually, so easy!

In all environments, I have core Grav containing the user folder of course. There's no point version controlling this.

Brief description today but hope that helps!

8 years ago

@hughbris - that is awesome. I am building a custom Grav theme right now, and I have that in a git repo, which makes it super easy to push changes. But your setup is a great idea, too!

8 years ago

Great! I'm meaning to document my process in detail and I want to encourage others to do the same. There's no right answer and I see a lot of questions about it.

8 years ago

The Git approach is really nice and works great. The only issue I have with this approach is that only 1 out of the 3 hosters I deal with supports ssh and git in combination with shared hosting.

A step-by-step-descripion of this Git approach can be found here Grav Development with GitHub - Part 2 (by Andy Miller). It includes a description for pulling the repo automatically once github get's updated from the dev server.

👍 1
last edited 07/10/18 by pamtbaau

Suggested topics

Topic Participants Replies Views Activity
Installation & Hosting · by antoinep, 22 hours ago
7 73 4 hours ago
Installation & Hosting · by Jürgen Dietrich, 7 months ago
0 65 7 months ago
Installation & Hosting · by rappluk, 8 months ago
0 65 8 months ago
Installation & Hosting · by N, 12 months ago
3 76 12 months ago
Installation & Hosting · by Youle, 1 year ago
1 65 1 year ago