Duplicate Ghost instance for translation purposes

Hi,

I have the following site:

which is localized in Bulgarian. I need to make it multilingual and I understood that the most stable and non-hacky way is to simply create a second instance of Ghost and cross link them. So my plan is to:

  1. Clone the dev.oliverkostoff.com to deven.oliverkostoff.com.
  2. Update the locale and translate the content of deven.oliverkostoff.com
  3. Add EN/BG button somewhere in the header and cross-link the sites.

Has someone cloned a Ghost instance to another URI in the same server ? ( I am self-hosting Ghost and have full root access to the host ) Any suggestions are welcome.

How are you hosting? Own VPS?

Suggested: Docker & nginx, Ghost language versions with separate /content directories mapped to your filesystem, not docker containers.

Docker-Ghost runs on different internal ports, set up nginx to proxy to the different ports, here I run Ghost on 2377 on arm64 host using docker compose. Run one language 2377, another on 2378 etc

services:
  ghost:
    image: ghost:latest
    restart: always
    ports:
      -  2377:2368
    environment:
      database__connection__host: db
      database__connection__user: root
      database__connection__password: pass12345
      database__connection__database: ghost
      url: https://language.example.com
    links:
      -  db
    volumes:
      -  /home/user/language/content:/var/lib/ghost/content
    depends_on:
      -  db
  db:
    image: arm64v8/mysql:8
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: pass12345
      MYSQL_DATABASE: ghost
      MYSQL_USER: ghost
      MYSQL_PASSWORD: otherpass12345
    volumes:
      - mysql-data:/var/lib/mysql

volumes:
  mysql-data:

Send more questions, docker + nginx is a very stable production environment

Hi @Oliver_Kostov

To me, it does not make much sense until Ghost adds multi-language support. I’ve chosen the option where I write articles in both languages using one instance, but mark them using different tags UA for Ukrainian and EN for English. So far so good.

You need to understand that all images you’ll need to host separately on each instance, or what is even worse - do a cross reference to images from one of the instances. It always an option to host images outside, but I definitile wouldn’t recommend it.

A lot of complexity in maintaining two instances adds as minimum the fact that you’ll need to reflect any changes in configuration/tags/layouts/styles/integrations and in each of your posts on your second instance.

Knowing today the amount of micro changes which I constantly doing when actively spend time with a my blog - I can say it should be hard to have two instances for different languages.

All above is only my humble experience and thoughts

Anyway I wish you a good luck with any option which you’ll prefer

Thanks @mheland for the suggestion. Currently I am running my only instance of Ghost as npm runtime with Nginx proxy in front. The host is Oracle Cloud instance from the free tier. Maybe I can containerize both the nodejs runtime, the proxy and the DB. Will get back to the thread when I manage to get it running.

@vlavrynovych thanks for the heads up. Luckily, my website is asymmetrical when it comes to blog posts ( not every post in EN needs to be translated to BG and vise versa ) . The pages are fairly static and the translation is one time effort. But you are right - Ghost is not a mature, multi-language platform. I love Ghost CMS for its ease of use ( and being PHP-free :D ) , but it lacks the flexibility and the functionality of some of the competition. Honestly, the trade off is totally worth it :)

1 Like

OK, it was really simple w/o containerization. Followed the instructions by ChatGPT and added few steps from my own experience. This is how I did it:

  1. Copy recursively the folder with the current instance to a new folder:
mkdir <absolute_path_of_new_site>
cp -r <absolute_path_of_existing_site> <absolute_path_of_new_site>
  1. Create dedicated MySQL user for the new site
mysql -u <admin_user> -p
CREATE DATABASE new_database_name;
CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'user_password';
GRANT ALL PRIVILEGES ON new_database_name.* TO 'new_user'@'localhost';
FLUSH PRIVILEGES;
  1. Update the config.production.json in the copied folder to reflect:
  • new FQDN
  • new app port
  • new DB credentials
  1. Make sure that your DNS would have proper A record for the new site

  2. IMPORTANT: In the <absolute_path_of_new_site> , do a recursive search for refs to the <absolute_path_of_existing_site>

grep -Ri <absolute_path_of_existing_site> .

Update them all. Pay attention to symlinks !

  1. In the <absolute_path_of_new_site> run:
ghost setup

and follow the instructions. If you did it properly, it will do the rest of the work ( nginx, TLS and systemd setup ) automagically

OPTIONAL:
You can use

ghost export <dump_file_name>

to dump the blog content from the old site
then import it to the new one with

ghost import <dump_file_name>