Skip to content

Instantly share code, notes, and snippets.

@fahdi
Created March 30, 2024 09:31
Show Gist options
  • Save fahdi/5a225425ddc5f8ca59ccbe747d5ff5e3 to your computer and use it in GitHub Desktop.
Save fahdi/5a225425ddc5f8ca59ccbe747d5ff5e3 to your computer and use it in GitHub Desktop.
Migrate a Ghost Website

Migrating a Ghost website from a development machine to a production environment involves several key steps. The exact process might vary depending on your specific setup, especially regarding your development and production environments, but the general approach is as follows:1. Backup Your Development SiteExport Content: Use the "Labs" section of the Ghost admin panel to export your content to a JSON file. This file includes all your posts, pages, tags, and settings.Backup Themes and Images: Manually copy your themes and images. Themes are typically located in the /content/themes/ directory, and images in the /content/images/ directory of your Ghost installation.2. Prepare the Production EnvironmentInstall Ghost: Ensure Ghost is installed on your production server. You can follow the official Ghost setup guide for various environments at the Ghost installation documentation.Setup Domain and SSL: Configure your domain and SSL certificate. Ghost CLI can automatically obtain a Let's Encrypt SSL certificate if you're using it for setup.Configure Email: Make sure your email settings are configured for system emails (like password resets). This usually involves editing the config.production.json file to include your mail server details.3. Transfer FilesTransfer Themes and Images: Upload the themes from your development site's /content/themes/ directory to the same location on your production server. Do the same for images from /content/images/.4. Import ContentImport Content: Use the "Labs" section of the Ghost admin panel on your production site to import the JSON file you exported from your development site. This will populate your production site with your posts, pages, tags, and settings.5. Test the Production SiteVerify Functionality: Check that all pages load correctly, all images are displayed, and the theme looks as expected.Test Email: Ensure that system emails (e.g., password reset) are being sent correctly.Check SEO Settings: Verify that your SEO settings and social media integrations are correctly configured.Additional TipsVersion Control for Themes: Consider using a version control system like Git for your theme development. This makes it easier to track changes and deploy updates to your production site.Automate Deployments: For a more streamlined process, look into deployment tools or services that can automate the transfer and setup steps.Security and Backups: Always ensure your production server is secure and that you have a system in place for regular backups.Remember, the specific commands and file locations might vary depending on your server setup (e.g., Nginx vs. Apache) and how you installed Ghost (e.g., Ghost-CLI vs. manual installation). Always refer to the official Ghost documentation and your hosting provider's resources for environment-specific instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment