Skip to content
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

Database Migration instructions #376

Open
manio143 opened this issue Aug 13, 2023 · 1 comment
Open

Database Migration instructions #376

manio143 opened this issue Aug 13, 2023 · 1 comment

Comments

@manio143
Copy link
Member

To migrate the data from old PostgreSQL database to the new one use the pg_dump command.
Under Windows it can be downloaded here: https://www.enterprisedb.com/download-postgresql-binaries
Under Linux you can get it with PostgreSQL installation.

.\pg_dump -f backup.sql -C -c -d <db-name> -h <host-name> -p 5432 -U <user-name>

Next remove a few top and bottom lines from the backup file which pertain to users (we come with a preexisting user in the new db).
Remove every line which assigns table ownership to a user.

Then run the backup file against the new database

.\psql -d <db-name> -h <host-name> -p 5432 -U <user-name> -f backup.sql

Finally execute the following to create the migrations table.

CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
    "MigrationId" character varying(150) NOT NULL,
    "ProductVersion" character varying(32) NOT NULL,
    CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
);

INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20230419204938_InitialCreate', '7.0.4');
@manio143 manio143 mentioned this issue Aug 13, 2023
52 tasks
@manio143
Copy link
Member Author

For anything we deserialize as a URI - we need to ensure it's a valid URI (with http:// prefix and not an empty string).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant