R
R
RabbitRun92022-02-11 16:37:30
MySQL
RabbitRun9, 2022-02-11 16:37:30

How are Postgresql and Mysql databases migrated?

Help clarify the situation and understanding about databases. There is a database such as Sqlite3, there is one file and everything is in it. With it, everything is simple, you wear it with the project and there are no problems.

And there are separate databases, Postgresql and Mysql are currently interested, a separate system is installed with them to support and operate this database.
And if, for example, I am developing a project and have already created certain records in the database, how can I then transfer it to the server (hosting) during deployment? After all, there is no longer one file.
And another question - if the site is already spinning on some server, and you have to transfer the site to another server, again - how to transfer the database, saving all the data? Is it too problematic?
And the third question - do various servers (hostings) provide database backups? Or do you need to do this yourself and set up a backup for yourself somehow? After all, if a database falls down (deleted, hacked and deleted, etc.) in which there are more than 1000+ different records and users, etc., then this is already very painful.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
F
FanatPHP, 2022-02-11
@FanatPHP

dump

A
AVKor, 2022-02-11
@AVKor

The dump has already been written about.

And the third question - do various servers (hostings) provide database backups? Or do you need to do this yourself and set up a backup for yourself somehow?

What you pay for is what you get.
If you serve the server yourself, then you do it yourself.

K
ky0, 2022-02-11
@ky0

You can make a dump with regular utilities.
You can, if your database is small or vice versa - hefty and its restoration takes a long time, put out the DBMS and copy datadir .

S
Saboteur, 2022-02-11
@saboteur_kiev

Many options
Make a dump and deploy it to another base.
Raise replication, wait until the databases are synchronized, remove the old one.
If the databases are the same version, you can, of course, stupidly copy the files, but this is rarely practiced.
When transferring data from one version to another, you need to look at what the vendor writes about this. It can either just turn around or require a special conversion procedure.

M
Michael, 2022-02-11
@Akela_wolf

Export data to SQL (see mysqldump, pg_dump). On the target system - load the resulting SQL.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question