save data to database on another VPS

smsoousa2 years ago

Hello friends. Is it possible to save data from one server to another server? For example, my system is at 192.168.1.1 and I want to save the data at 192.168.1.20. It's possible?

Sydney Retamales2 years ago

Hi, If it is possible to write the data to another server, please attach the configuration link https://www.traccar.org/configuration/ and grant the respective communication permissions according to the database engine.

Rhamean2 years ago

Hi dear,
here is the command :

// data only:
$ sudo mysqldump -h [remote server ip] -t -u [user] --port 3306 -p -t [database] [table] > records_of_table.sql
// Structure only:
$ sudo mysqldump -h [remote server ip] -d -u [user] --port 3306 -p -d [database] [table] > structure_of_table.sql
Rhamean2 years ago

You should be able to login into 192.168.1.20 or maybe using $ ssh user@192.168.1.20, so in this case the [remote server ip] will be 192.168.1.1 when you use the commands above.
Your data will be saved from 192.168.1.1 into your present server(which where you are).
I hope it helps.

Rhamean2 years ago

do not forget doing these steps for '192.168.1.1' which you are going to connect to remotely:
1.

$ sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf    // put '#' before "bind-address = 127.0.0.1" and "mysqlx-bind-address = 127.0.0.1" lines.
$ sudo mysql -u root -p
mysql> create user '[user]'@'%' identified by '[password]';
mysql> grant all privileges on *.* to '[user]'@'%' with grant option;
mysql> flush privileges;
mysql> exit;
$ sudo systemctl restart mysql.services

Now you shoud be able to command remotely with mysql on '192.168.1.1'