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

Backup ClickHouse schema_migrations table #2

Open
schnerring opened this issue Apr 23, 2022 · 1 comment
Open

Backup ClickHouse schema_migrations table #2

schnerring opened this issue Apr 23, 2022 · 1 comment

Comments

@schnerring
Copy link
Owner

Currently the plausible.schema_migrations ClickHouse table isn't backed up because clickhouse-backup only supports MergeTree family tables.

In case of disaster recovery, the table has to be reconstructed with the following script:

NOTE: the query depends on the Plausible version. The following query is for Plausible v1.4.4

INSERT INTO plausible.schema_migrations (version,inserted_at) VALUES
	 (20200915070607,'2022-04-22 04:07:40'),
	 (20200918075025,'2022-04-22 04:07:40'),
	 (20201020083739,'2022-04-22 04:07:40'),
	 (20201106125234,'2022-04-22 04:07:40'),
	 (20210323130440,'2022-04-22 04:07:40');
@schnerring
Copy link
Owner Author

For v1.5.1, the query is:

INSERT INTO plausible.schema_migrations (version,inserted_at) VALUES
	 (20200915070607,'2022-04-22 04:07:40'),
	 (20200918075025,'2022-04-22 04:07:40'),
	 (20201020083739,'2022-04-22 04:07:40'),
	 (20201106125234,'2022-04-22 04:07:40'),
	 (20210323130440,'2022-04-22 04:07:40'),
	 (20210712214034,'2023-03-19 03:03:24'),
	 (20211017093035,'2023-03-19 03:03:24'),
	 (20211112130238,'2023-03-19 03:03:25'),
	 (20220310104931,'2023-03-19 03:03:25'),
	 (20220404123000,'2023-03-19 03:03:25'),
	 (20220421161259,'2023-03-19 03:03:26'),
	 (20220422075510,'2023-03-19 03:03:26');

Regarding clickhouse-backup support for TinyLog engine tables, see:

Altinity/clickhouse-backup#238 (comment)

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