How to clone database?

System Information
  • Strapi Version: v3.5.4
  • Operating System: Windows 10 & Ubuntu 20.04
  • Database: PostgreSQL
  • Node Version: 12.22.1
  • NPM Version: 6.14.12
  • Yarn Version: 1.22.10

How can you clone a PostgreSQL database from Windows 10 to Ubuntu 20.04?

I want to clone my project from my computer to the server. I know how to clone the repository via git, but how can I clone a database. I watched this video https://youtu.be/Rw7FTdhbgI8?t=629 and I just understood that you needed to clone the database, but they didn’t explain how. What method do you recommend and how can I do it? I’m pretty new to databases.

Hey :slight_smile:

Check out your config/databases.js file in your strapi backend project. If you not changed something yet you will find that your data is actually stored on you computer in your strapi project (.tmp/data.db). For production deployment, you shouldn’t just copy/clone the file and put it on your server…
You should configure your config/databases.js according to the database you are either running yourself on your Ubunto or cosnider using a DB hosting provider and configure it (something like https://www.elephantsql.com/)

Also, check out the strapi on Heroku (with PostgresQL) tutorial here: Heroku

1 Like

So I should connect my local project to the database on my server? I want to host everything from a VPS because my school provides me with a free VPS and I learn alot more about Linux.

To clarify I want to export the database from my Local Windows 10 computer and import it to my Ubuntu 20.04 server. I use PostgreSQL version 12.6 on both my Windows computer and my Ubuntu server. I have setup Strapi with PostgreSQL, and it is utilising it.

1 Like