Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 831e45d

Browse files
Add instructions for reverting from a split database to a single database (#8422)
* Added initial draft * Removed DB table count * Apply suggestion from tech review * Apply suggestions from editorial review * Updated TOC
1 parent 413025a commit 831e45d

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

src/_data/toc/configuration-guide.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,9 @@ pages:
353353
- label: Set up optional database replication
354354
url: /config-guide/multi-master/multi-master_slavedb.html
355355

356+
- label: Revert from a split database to a single database
357+
url: /config-guide/revert-split-database.html
358+
356359
- label: Custom Logging
357360
url: /config-guide/log/log-intro.html
358361
children:
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
group: configuration-guide
3+
title: Revert from a split database to a single database
4+
ee_only: true
5+
functional_areas:
6+
- Configuration
7+
- System
8+
- Setup
9+
---
10+
11+
The [split database]({{ page.baseurl }}/config-guide/multi-master/multi-master.html) feature was deprecated in version 2.4.2 of {{ site.data.var.ee }}. Follow these instructions to revert from a split database to a single database implementation.
12+
13+
## Revert a split database implementation
14+
15+
Reverting from a split database to a single database implementation involves creating backups of the `magento_quote` and `magento_sales` databases before loading them into the single `magento_main` database.
16+
17+
In this example, we log in to all three databases, which are installed on the same host (`magento2-mysql`) as the "root" user. You must replace these values with the appropriate values for your databases.
18+
19+
1. Create a backup of the `magento_quote` database:
20+
21+
```bash
22+
mysqldump -h "magento2-mysql" -u root -p magento_quote > ./quote.sql
23+
```
24+
25+
1. Create a backup of the `magento_sales` database:
26+
27+
```bash
28+
mysqldump -h "magento2-mysql" -u root -p magento_sales > ./sales.sql
29+
```
30+
31+
1. Load the `magento_quote` database into the `magento_main` database:
32+
33+
```bash
34+
mysql -h "magento2-mysql" -u root -p magento_main < ./quote.sql
35+
```
36+
37+
1. Load the `magento_sales` database into the `magento_main` database:
38+
39+
```bash
40+
mysql -h "magento2-mysql" -u root -p magento_main < ./sales.sql
41+
```
42+
43+
1. Drop the `magento_sales` database:
44+
45+
```bash
46+
mysql -h "magento2-mysql" -u root -p -e "DROP DATABASE magento_sales;"
47+
```
48+
49+
1. Drop the `magento_quote` database:
50+
51+
```bash
52+
mysql -h "magento2-mysql" -u root -p -e "DROP DATABASE magento_quote;"
53+
```
54+
55+
1. Remove the deployment configuration for `checkout` and `sales` in the `connections` and `resources` sections of the `env.php` file.
56+
1. Restore foreign keys:
57+
58+
```bash
59+
bin/magento setup:upgrade
60+
```
61+
62+
## Verify your work
63+
64+
To verify that your single database implementation is working properly, perform the following tasks and verify that data is added to the `magento_main` database tables using a database tool like [phpMyAdmin]({{ page.baseurl }}/install-gde/prereq/optional.html#install-optional-phpmyadmin):
65+
66+
1. Verify that foreign keys have been restored. For example, the `QUOTE_STORE_ID_STORE_STORE_ID` key in the `quote` database table.
67+
1. Verify that customers can place orders from the storefront.
68+
1. Verify that orders created before reverting the split database to a single database are available in the Admin.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../v2.3/config-guide/revert-split-database.md

0 commit comments

Comments
 (0)