Overview

The sync server enables seamless exchange of notes between the BuchNotizApp (mobile) and the desktop app. This guide describes how to configure synchronization for all involved components.

Prepare the sync server

Make sure the sync server is installed and accessible (see Server Installation).

Check the following settings in the server configuration (`config.php`):

```php // Synchronization interval in seconds define('SYNC_INTERVAL', 300);

// Maximum file size for notes (in bytes) define('MAX_NOTE_SIZE', 1048576);

// Conflict strategy: 'ask', 'newest', 'server' define('CONFLICT_STRATEGY', 'ask'); ```

Configure the desktop app

1. Set up server connection

Open Settings > Synchronization and enter the following details:

- Server URL: `https://sync.mydomain.com` - Username: Your sync server username - Password: Your sync server password

Click "Test Connection" to verify connectivity.

2. Set sync options

- Automatic synchronization: Enable this option to sync notes automatically in the background. - Sync interval: Choose how often synchronization should occur (default: every 5 minutes). - Conflict handling: Choose whether to prompt on conflicts, prefer the newest version, or use the server version.

Configure the BuchNotizApp

In the app, open Settings > Synchronization and enter the same server URL and credentials. Enable "Automatic Synchronization" and choose whether to sync only over Wi-Fi or also over mobile data.

Troubleshooting

Connection failed

- Verify the server URL is correct (with `https://`) - Make sure the SSL certificate is valid - Check your server's firewall settings

Synchronization stalls

- Check the server logs at `/var/www/sync/logs/` - Make sure there is enough storage space on the server - Restart the sync service

Note conflicts

When the same note has been edited on multiple devices, the app shows a conflict dialog. You can choose which version to keep or merge both together.