How to transfer data between servers?

I have two servers.
On one server, I create documents, or new records in doctypes.
How to transfer the generated data to another server?

If servers are hosting identical ERPNext use bench backup on one server and bench restore to other one.

Is this working in realtime? For every document?
Why not using REST API?

@11113,
If you mean to have doctype in 1 server and database in other server, you can use the bench to set remote db host:

  • --db-host Custom database host URL for remote connection

Search in this forum for will give you some guidance.

You have event streaming functionality for this in v13.
If it’s only DB then search for how to setup Galera cluster.

Hey rahy, can you explain how can I use rest api. Thanks in advance

I think you better read the docs first. It is comprehensive.

https://docs.erpnext.com/docs/v13/user/manual/en/customize-erpnext/server-script

https://frappeframework.com/docs/v13/user/en/introduction

@nikita_sharma you can use event streaming functionality to sync documents realtime.

it can be possible on two local server?

Check out the documentation Event Streaming