Send changes from one database to another
Greetings.
There are two VDS servers on which 2 Telegram bots are installed, custom-made in PHP. Both servers have identical 1-to-1 bots installed.
What is needed.
On one VDS server, there is a Telegram bot where people send messages, and these messages are sent to me on the same server in the admin panel of the website. There, I can respond to the person, and the response will be sent back to the Telegram bot from which they initially wrote. In this admin panel on the website, there is information about the person who wrote to me, specifically their balance. This balance is not editable. The goal is to ensure that changes are not made on the current server, and the client's balance is not pulled from the bot they wrote to. Instead, the balance should be pulled and editable from another server where the database is located. The database contains a table with user balances. Additionally, in the client information, there is the number of orders. It is necessary to ensure that this number is also pulled not from the bot they are writing to, but from another server of my bot with the table in the database.
-
Hello!
The task is clear, and it is absolutely feasible. We can set up a secure data exchange between your servers so that information about balances and orders is pulled from the necessary database and updated correctly.
To offer you the best solution and accurately assess the scope of work, I need to review the connection code to the databases on both servers.
I am ready to start the analysis as soon as you provide access. After that, we can immediately begin work.
-
278 5 1 1 Hello,
I propose the architecture:
A) Direct connection to the remote database (minimum code and budget)
The admin panel on VDS-1 reads/writes the balance and reads the order count directly in the database on VDS-2.
Technically: a separate database user with minimal rights, IP-whitelist through the firewall, TLS, prepared queries.
B) Lightweight API on VDS-2 (slightly more expensive, but more flexible and secure)
… On VDS-2, we will set up a mini-service (PHP/NGINX), endpoints:
GET /user/{tg_id} → balance, orders; PATCH /user/{tg_id}/balance; HMAC signature + IP whitelist.
The admin panel on VDS-1 accesses this API, the database remains closed to the outside.
What I will do:
1. The balance and the number of orders in the user card will always come from VDS-2 (single source).
2. In the admin panel on VDS-1, editing the balance writes to the database on VDS-2 (with change logs).
3. Protection: IP whitelist, accounts with minimal rights, prepared queries, optionally TLS.
4. Documentation on integration points and rollback.
Option A (direct connection to the database on VDS-2)
19 hours → $285, deadline 2–3 working days
1. Code audit, access, data schema — 2 hours / $30
2. Network connection: firewall, database role, TLS — 3 hours / $45
3. Admin panel modification: reading balance/orders from VDS-2 — 4 hours / $60
4. Admin panel modification: writing balance to VDS-2 + logs — 5 hours / $75
5. e2e tests, bot regression, fixes — 3 hours / $45
6. Documentation, rollback checklist — 2 hours / $30
Option B (mini-API on VDS-2):
25 hours → $375, deadline 3–4 working days
(items from option A are replaced with API development: GET/PATCH routes, HMAC signature, validation, PHP client in the admin panel)
We will start with the most budget-friendly A. If security/policies require an API — we switch to B without redesigning the data model.
1. What database is on VDS-2 (MySQL/MariaDB/Postgres) and its version?
2. Where are the balance and orders_count currently stored (table/field names)? Do the schemas differ on VDS-1 and VDS-2?
3. Is it necessary to keep a history of balance changes and comments on edits in the admin panel?
4. Are there any requirements for channel encryption (TLS to the database) or is VPN/firewall + localhost proxy sufficient?
5. Do we limit access by IP from VDS-1 or will multiple addresses be needed (staging)?
6. Can SSH/PhpMyAdmin/config access be provided for a short audit (read-only)?
7. Are notifications in logs/Telegram needed when the balance changes?
I work through a safe.
-
2642 6 1 Hello! I see that you need to ensure synchronization and editing of user order balances and quantities between two servers with Telegram bots on PHP. For this, a reliable data exchange between the databases on the servers can be implemented through an API or direct connection to the remote database, so the admin panel always retrieves up-to-date information from the main server. I have experience integrating Telegram bots with external databases and building connections between distributed systems. I am ready to discuss the details, propose a solution architecture, and quickly get to work for correct data exchange between your VDS and bots.
-
195 1 0 Hello, perhaps a good option would be to make a request from one side to obtain this invoice, and on the other end there will be an API that will accept this request, so in the future it will be possible to connect these two bots.
-
360 Hello Andriy, I can help you solve your problem, let's discuss the details in private messages.
-
457 Good day,
I can implement the connection of the admin panel to the server with the database via API to retrieve data from the database, not from the bot.
I would be happy to collaborate!
-
259 1 0 Good afternoon.
I can help you with your problem.
Feel free to reach out.
-
2885 42 0 Good day.
The task is clear, I can implement it quickly.
I have experience with php, mysql, vds.
We can discuss the details and implement data duplication, or change the direction in another database.
-
1323 35 1 Good day. Contact me, I will do it.
++++++++++++++++++++++++++++++
-
368 Good afternoon.
I understand that you need to add a new API that will allow pulling the necessary information between servers.
I will do it in the best way, as an addition that will not interfere with the code update of the bots themselves.
Current freelance projects in the category PHP
Improvement of the website https://koleso-center.com/ on OpenCart
223 USD
Add categories to the online store websiteUsed disksSpare tiresFastenersData is taken from the 1C database.A few more questions Type of performer: single Backend developer (OpenCart/PHP) at the Middle levelThe modifications must meet all requirementsSEO + AI promotion AI… PHP ∙ 12 hours 4 minutes back ∙ 30 proposals |
Module for OpenCart: mass creation of products from folders with imagesDevelopment of a mass product creation module for OpenCart (ocStore 3.x) A backend module for OpenCart / ocStore 3.x needs to be developed that automatically creates products from a pre-prepared folder structure with images.Main functionality: mass creation of products from… Content Management Systems, PHP ∙ 1 day 18 hours back ∙ 46 proposals |
Looking for a Bitrix24 specialist / CRM integrator to set up automation.Our company works with CRM Bitrix24. We need a specialist who can set up automatic addition of phone numbers to leads/orders in two formats. Automation must be correctly configured for two countries: the Republic of Moldova and Romania. Task: When creating a lead or order in… PHP, Web Programming ∙ 4 days 20 hours back ∙ 24 proposals |
Website optimizationOptimization of the website jdgreta.co.uk on Shopify. SEO audit attached to the project. Main tasks - - Fix all meta data - Complete the technical specifications for the programmer (since this project combines tasks for both the programmer and SEO, if you are not a company -… HTML & CSS, PHP ∙ 5 days 17 hours back ∙ 33 proposals |
Horoshop SpecialistNeed a specialist who can correctly set up the product Feed. Problem: Currently, over 13,000 products are being uploaded with the same type value (e.g., "everything for manicure and pedicure"). Because of this, it is impossible to segment products in Google Ads and set different… PHP, Website Maintenance ∙ 6 days 19 hours back ∙ 21 proposals |