-
Notifications
You must be signed in to change notification settings - Fork 0
Multiple Databases
L.O.R.E. v1.1.0 introduced support for multiple database connections, allowing large grids to sync regions from up to 5 different Robust databases simultaneously.
- Load-balanced grids where regions are sharded across multiple database servers for performance
- Multi-server setups with different Robust databases on different physical machines
- Migration scenarios where you need to sync from both old and new databases during transition
- Testing environments where you want to combine production and test regions in one map
- Your grid has all regions in a single Robust database (most grids)
- You're just getting started with a small grid
- Your database has fewer than 5,000 regions
For 90% of grids, the primary database alone is all you need!
Large OpenSim grids sometimes split their regions table across multiple databases for performance reasons:
Database 1 (db1.yourgrid.com) → Regions 1-500
Database 2 (db2.yourgrid.com) → Regions 501-1000
Database 3 (db3.yourgrid.com) → Regions 1001-1500
Each database has its own regions table with a subset of your grid's regions. L.O.R.E. connects to ALL of them and merges the data into one unified map!
- Go to Settings → L.O.R.E. Map
- Scroll to OpenSimulator Database(s) section
- Fill in your Primary Database credentials (left column):
- Database Host
- Database Name
- User
- Password
This is required and works exactly like v1.0.x - your main Robust database.
Look at the right column - you'll see Database 2, 3, 4, and 5.
- Check the box next to "Database 2"
- The fields will slide open
- Fill in the credentials for your second database
- Repeat for Database 3, 4, 5 as needed
Only enable the databases you actually have! Leave unused databases unchecked.
Click Save Settings at the bottom of the page.
- Scroll to Region Sync section
- Click Sync Regions Now
- Watch the progress bar - it will sync from ALL enabled databases
- Success message shows total regions synced
- Always visible
- Blue border indicates it's the main database
- Required for L.O.R.E. to work
- Each has a checkbox toggle
- Click checkbox → fields appear/hide
- Compact layout saves space
- Only shows what you need
Example Setup:
✓ Primary Database ✓ Database 2
Host: db1.grid.com Host: db2.grid.com
Name: robust Name: robust
User: lore_user User: lore_user
Pass: **** Pass: ****
☐ Database 3 (disabled)
☐ Database 4 (disabled)
☐ Database 5 (disabled)
When you click Sync Regions Now, L.O.R.E.:
-
Clears the WordPress
wp_lore_regionstable - Connects to Primary Database → syncs regions in batches of 50
- Connects to Database 2 (if enabled) → syncs its regions
- Connects to Database 3 (if enabled) → syncs its regions
- Continues for all enabled databases
- Deduplicates by UUID - if same region appears in multiple databases, keeps the most recent
Result: One unified map with all regions from all databases!
- Total regions synced across ALL databases
- Current batch number
- Percentage complete
✅ Synced 1,247 regions successfully!
(from 3 database(s))
If one database fails, sync continues with the others. Check the error message to see which database had issues.
Good news: Auto-sync works seamlessly with multiple databases!
- Enable Automatic Daily Sync checkbox
- Save settings
- Every day at 3:00 AM, L.O.R.E. syncs from ALL enabled databases
- Check WordPress error log to verify:
L.O.R.E. Auto-Sync Primary: Synced 450 regions L.O.R.E. Auto-Sync DB2: Synced 400 regions L.O.R.E. Auto-Sync DB3: Synced 397 regions L.O.R.E. Auto-Sync: Total synced 1247 regions from 3 database(s)
For Database 1:
CREATE USER 'lore_db1'@'%' IDENTIFIED BY 'secure_password_1';
GRANT SELECT ON robust.regions TO 'lore_db1'@'%';
FLUSH PRIVILEGES;For Database 2:
CREATE USER 'lore_db2'@'%' IDENTIFIED BY 'secure_password_2';
GRANT SELECT ON robust2.regions TO 'lore_db2'@'%';
FLUSH PRIVILEGES;Repeat for each database. Use different passwords for each!
If databases are on different servers:
- Open port 3306 on each database server
- Allow connections from your WordPress server IP only
- Consider using SSH tunnels for extra security
Cause: Database 2 credentials are wrong or server is unreachable.
Fix:
- Test credentials with phpMyAdmin or MySQL client
- Check firewall allows connections from WordPress server
- Verify
bind-addressin MySQL config allows remote connections - Confirm Database 2 checkbox is actually checked
Cause: One of your databases didn't sync.
Fix:
- Check success message - does it show all databases?
- Review WordPress error log for connection failures
- Manually test each database connection
- Temporarily disable problem databases to isolate the issue
Cause: Same region UUID exists in multiple databases.
Fix: This is normal! L.O.R.E. uses REPLACE instead of INSERT, so the most recently synced version wins. No duplicates appear on the map.
Cause: Syncing 5 databases with 1,000+ regions each takes time!
Fix:
- This is normal for very large grids
- Batch size is 50 per database - can't be increased safely
- Enable auto-sync so you don't need to manually sync often
- Be patient - even 5,000 regions only takes ~3 minutes total
Keep notes on which database contains which regions:
Primary: Mainland regions (1-500)
DB2: Private estates (501-1000)
DB3: Event regions (1001-1200)
Use phpMyAdmin or MySQL Workbench to verify each database connection BEFORE entering in L.O.R.E.
After enabling auto-sync, check logs the next morning:
tail -f /path/to/wordpress/wp-content/debug.log | grep "L.O.R.E"
Even if you eventually need multiple databases:
- Configure Primary Database first
- Sync and test
- Add Database 2 once Primary works
- Test again
- Continue adding databases one at a time
If possible, name your databases similarly:
-
robust1,robust2,robust3(good) -
main_db,regions_backup,test_robust(confusing)
Problem: You're moving from old_server to new_server but some regions are still on old database.
Solution:
- Primary Database → new server (db.newserver.com)
- Database 2 → old server (db.oldserver.com)
- Enable both, sync
- Map shows ALL regions from both servers!
- As you migrate regions, they appear in new database
- When migration complete, disable Database 2
Q: Does syncing 5 databases slow down sync?
A: Slightly, but not significantly.
- Single database: ~500 regions in 10 seconds
- 5 databases: ~2,500 regions in 50 seconds
Batch processing ensures no timeouts regardless of database count.
Q: Does this slow down my map?
A: No! Once synced, all regions are in one WordPress table. The map loads exactly the same speed whether you have 1 database or 5.
To stop using a database:
- Uncheck the checkbox next to it
- Save Settings
- Manual Sync to remove its regions from the map
Old regions from disabled databases remain in wp_lore_regions until next sync clears the table.
- Configuration Guide - All L.O.R.E. settings explained
- Troubleshooting - Fix common issues
- Auto-Sync Setup - Enable daily automatic updates
Questions? Ask in GitHub Discussions!