-
Notifications
You must be signed in to change notification settings - Fork 50
[Migration Engine Part 1] Implement the foundation for migration engine #5894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
+4,601
−7
Draft
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
cab61ee
Add migration overview documentation for RavenDB to SQL transition
warwickschroeder 7f1a100
Refine migration overview documentation for RavenDB to SQL transition
warwickschroeder 9173ec2
Clarify documentation on RavenDB source requirements for containerize…
warwickschroeder 82ea176
Enhance migration overview documentation for RavenDB to SQL transitio…
warwickschroeder 6028d94
Implement the foundation for migration engine
warwickschroeder 3a0263a
Add unit tests for migration engine functionality and improve migrati…
warwickschroeder 259cb82
Clarify migration overview by detailing additional skip conditions fo…
warwickschroeder 818b0e7
PR review fixes
warwickschroeder fa6c14e
PR review
warwickschroeder 4bc951e
Enhance migration engine to handle benign skips and update related tests
warwickschroeder 0dcf9c8
Enhance Migration Engine and Unit Tests
warwickschroeder 94c8cab
Refactor migration settings and update documentation to remove RavenD…
warwickschroeder 8482252
Clarify event log handling and data retention during migration from R…
warwickschroeder bbdbcb7
Update migration documentation to clarify integration events and erro…
warwickschroeder e9f6da8
Refine migration documentation for clarity on data retention and copy…
warwickschroeder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Migrating from RavenDB to SQL Server or PostgreSQL | ||
|
|
||
| This page covers what you can run today. How the migration works, and what is planned, is in the [migration overview](ravendb-to-sql-migration-overview.md) and the [system design diagram](migration-system-design-diagram.png). | ||
|
|
||
| > [!NOTE] | ||
| > Copying data is not built yet. The one migration command available is the source report. It sends RavenDB only reads, but loading a database lets RavenDB's own expiration, its automatic deletion of documents past their retention date, run against it. If you are keeping the RavenDB database as a fallback, back it up before you run the report, as [Goals](ravendb-to-sql-migration-overview.md#goals) explains. | ||
|
|
||
| ## Before you start | ||
|
|
||
| The source is a ServiceControl error instance on RavenDB. Keep its RavenDB settings in its configuration: the migration reads RavenDB through them, including after `PersistenceType` is switched to SQL Server or PostgreSQL. | ||
|
|
||
| | Setting | Environment variable | What it is | | ||
| | --- | --- | --- | | ||
| | `ServiceControl/RavenDB/ConnectionString` | `SERVICECONTROL_RAVENDB_CONNECTIONSTRING` | An external RavenDB server. Leave unset for an embedded database | | ||
| | `ServiceControl/DbPath` | `SERVICECONTROL_DBPATH` | The embedded database's data directory | | ||
| | `ServiceControl/RavenDB/DatabaseName` | `SERVICECONTROL_RAVENDB_DATABASENAME` | The primary database, `primary` by default | | ||
| | `LicensingComponent/RavenDB/ThroughputDatabaseName` | `LICENSINGCOMPONENT_RAVENDB_THROUGHPUTDATABASENAME` | The throughput database, `throughput` by default | | ||
| | `ServiceControl/RavenDB/ClientCertificatePath` or `ServiceControl/RavenDB/ClientCertificateBase64`, with `ServiceControl/RavenDB/ClientCertificatePassword` | `SERVICECONTROL_RAVENDB_CLIENTCERTIFICATEPATH` and so on | A secured external server's client certificate | | ||
| | `ServiceControl/ErrorRetentionPeriod` | `SERVICECONTROL_ERRORRETENTIONPERIOD` | Required. Don't change it during the move | | ||
|
|
||
| ## Report on the source | ||
|
|
||
| Run the instance's executable with `--migration-source-report`: | ||
|
|
||
| ```powershell | ||
| # Installed on Windows, from the instance's installation folder | ||
| .\ServiceControl.exe --migration-source-report | ||
| ``` | ||
|
|
||
| ```shell | ||
| # Container, against an external RavenDB server | ||
| docker run --rm --env-file servicecontrol.env ghcr.io/particular/servicecontrol:<version> --migration-source-report | ||
| ``` | ||
|
|
||
| From source, build `src/ServiceControl` and run the same command from its output folder, as in [How to run/debug locally](../../README.md#how-to-rundebug-locally). | ||
|
|
||
| The report prints the RavenDB server version, whether the source is embedded or external and where it is, both database names with the setting each came from, and a row count for every collection in both databases. | ||
|
|
||
| - **External server:** run it while ServiceControl is running. It sends only reads, and the note above about expiration applies to a server you are keeping as a fallback. | ||
| - **Embedded database:** stop the ServiceControl service, run the report, then start the service again. The report starts its own RavenDB process against the data directory, which cannot happen while the instance holds it. | ||
| - **Container with an embedded database:** not supported, because the container image does not ship the RavenDB server. Point the instance at an external RavenDB server instead. | ||
|
|
||
| ## If the report fails | ||
|
|
||
| The error names the setting to fix: | ||
|
|
||
| - **"has no database named ..."**: the database name setting it quotes is wrong. | ||
| - **"refused its client certificate access ..."**: grant that certificate Read access to the database, or supply a certificate that has it. | ||
|
|
||
| ## Not available yet | ||
|
|
||
| Copying the data (`MigrationMode`), the dry run, and the status and verify commands are planned but not built. The planned steps are in [Migration workflow](ravendb-to-sql-migration-overview.md#migration-workflow). | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.