INSERT INTO "settings" ("id", "mail_server", "mail_port", "mail_use_ssl", "mail_login", "mail_password", "mail_from", "config_calibre_dir", "config_port", "config_certfile", "config_keyfile", "config_calibre_web_title", "config_books_per_page", "config_random_books", "config_read_column", "config_title_regex", "config_log_level", "config_uploading", "config_anonbrowse", "config_public_reg", "config_default_role", "config_default_show", "config_columns_to_ignore", "config_use_google_drive", "config_google_drive_folder", "config_google_drive_watch_changes_response", "config_remote_login", "config_use_goodreads", "config_goodreads_api_key", "config_goodreads_api_secret", "config_mature_content_tags", "config_logfile", "config_ebookconverter", "config_converterpath", "config_calibre", "config_rarfile_location", "config_authors_max", "config_theme", "config_access_log", "config_access_logfile", "config_kobo_sync", "config_denied_tags", "config_allowed_tags", "config_restricted_column", "config_denied_column_value", "config_allowed_column_value", "config_login_type", "config_kobo_proxy", "config_ldap_provider_url", "config_ldap_port", "config_ldap_schema", "config_ldap_serv_username", "config_ldap_serv_password", "config_ldap_use_ssl", "config_ldap_use_tls", "config_ldap_require_cert", "config_ldap_cert_path", "config_ldap_dn", "config_ldap_user_object", "config_ldap_openldap", "config_updatechannel", "config_reverse_proxy_login_header_name", "config_allow_reverse_proxy_header_login", "mail_size", "mail_server_type", "mail_gmail_token", "config_external_port", "config_register_email", "config_ldap_authentication", "config_ldap_encryption", "config_ldap_cacert_path", "config_ldap_key_path", "config_ldap_member_user_object", "config_ldap_group_object_filter", "config_ldap_group_members_field", "config_ldap_group_name", "config_kepubifypath", "config_upload_formats", "mail_password_e", "config_ldap_serv_password_e", "config_calibre_uuid", "config_calibre_split", "config_calibre_split_dir", "config_trustedhosts", "config_default_language", "config_default_locale", "config_binariesdir", "config_unicode_filename", "config_embed_metadata", "schedule_start_time", "schedule_duration", "schedule_generate_book_covers", "schedule_generate_series_covers", "schedule_reconnect", "schedule_metadata_backup", "config_password_policy", "config_password_min_length", "config_password_number", "config_password_lower", "config_password_upper", "config_password_character", "config_password_special", "config_session", "config_ratelimiter", "config_limiter_uri", "config_limiter_options", "config_check_extensions")
SELECT "id", "mail_server", "mail_port", "mail_use_ssl", "mail_login", "mail_password", "mail_from", "config_calibre_dir", "config_port", "config_certfile", "config_keyfile", "config_calibre_web_title", "config_books_per_page", "config_random_books", "config_read_column", "config_title_regex", "config_log_level", "config_uploading", "config_anonbrowse", "config_public_reg", "config_default_role", "config_default_show", "config_columns_to_ignore", "config_use_google_drive", "config_google_drive_folder", "config_google_drive_watch_changes_response", "config_remote_login", "config_use_goodreads", "config_goodreads_api_key", "config_goodreads_api_secret", "config_mature_content_tags", "config_logfile", "config_ebookconverter", "config_converterpath", "config_calibre", "config_rarfile_location", "config_authors_max", "config_theme", "config_access_log", "config_access_logfile", "config_kobo_sync", "config_denied_tags", "config_allowed_tags", "config_restricted_column", "config_denied_column_value", "config_allowed_column_value", "config_login_type", "config_kobo_proxy", "config_ldap_provider_url", "config_ldap_port", "config_ldap_schema", "config_ldap_serv_username", "config_ldap_serv_password", "config_ldap_use_ssl", "config_ldap_use_tls", "config_ldap_require_cert", "config_ldap_cert_path", "config_ldap_dn", "config_ldap_user_object", "config_ldap_openldap", "config_updatechannel", "config_reverse_proxy_login_header_name", "config_allow_reverse_proxy_header_login", "mail_size", "mail_server_type", "mail_gmail_token", "config_external_port", "config_register_email", "config_ldap_authentication", "config_ldap_encryption", "config_ldap_cacert_path", "config_ldap_key_path", "config_ldap_member_user_object", "config_ldap_group_object_filter", "config_ldap_group_members_field", "config_ldap_group_name", "config_kepubifypath", "config_upload_formats", "mail_password_e", "config_ldap_serv_password_e", "config_calibre_uuid", "config_calibre_split", "config_calibre_split_dir", "config_trustedhosts", "config_default_language", "config_default_locale", "config_binariesdir", "config_unicode_filename", "config_embed_metadata", "schedule_start_time", "schedule_duration", "schedule_generate_book_covers", "schedule_generate_series_covers", "schedule_reconnect", "schedule_metadata_backup", "config_password_policy", "config_password_min_length", "config_password_number", "config_password_lower", "config_password_upper", "config_password_character", "config_password_special", "config_session", "config_ratelimiter", "config_limiter_uri", "config_limiter_options", "config_check_extensions" FROM main."settings" where id > 1;

INSERT INTO "registration" ("id", "domain", "allow")
SELECT "id", "domain", "allow" FROM main."registration";

INSERT INTO "bookmark" ("id", "user_id", "book_id", "format", "bookmark_key")
SELECT "id", "user_id", "book_id", "format", "bookmark_key" FROM main."bookmark";

INSERT INTO "shelf" ("id", "name", "is_public", "user_id", "uuid", "created", "last_modified")
SELECT "id", "name", "is_public", "user_id", "uuid", "created", "last_modified" FROM main."shelf";

INSERT INTO "downloads" ("id", "book_id", "user_id")
SELECT "id", "book_id", "user_id" FROM main."downloads";

INSERT INTO "remote_auth_token" ("id", "auth_token", "user_id", "verified", "expiration", "token_type")
SELECT "id", "auth_token", "user_id", "verified", "expiration", "token_type" FROM main."remote_auth_token";

INSERT INTO "book_read_link" ("id", "book_id", "user_id", "is_read", "read_status", "last_modified", "last_time_started_reading", "times_started_reading")
SELECT "id", "book_id", "user_id", "is_read", "read_status", "last_modified", "last_time_started_reading", "times_started_reading" FROM main."book_read_link";

INSERT INTO "book_shelf_link" ("id", "book_id", "order", "shelf", "date_added")
SELECT "id", "book_id", "order", "shelf", "date_added" FROM main."book_shelf_link";

INSERT INTO "oauthProvider" ("id", "provider_name", "oauth_client_id", "oauth_client_secret", "active")
SELECT "id", "provider_name", "oauth_client_id", "oauth_client_secret", "active" FROM main."oauthProvider";

INSERT INTO "flask_dance_oauth" ("id", "provider", "created_at", "token", "provider_user_id", "user_id")
SELECT "id", "provider", "created_at", "token", "provider_user_id", "user_id" FROM main."flask_dance_oauth";

INSERT INTO "shelf_archive" ("id", "uuid", "user_id", "last_modified")
SELECT "id", "uuid", "user_id", "last_modified" FROM main."shelf_archive";

INSERT INTO "archived_book" ("id", "user_id", "book_id", "is_archived", "last_modified")
SELECT "id", "user_id", "book_id", "is_archived", "last_modified" FROM main."archived_book";

INSERT INTO "kobo_reading_state" ("id", "user_id", "book_id", "last_modified", "priority_timestamp")
SELECT "id", "user_id", "book_id", "last_modified", "priority_timestamp" FROM main."kobo_reading_state";

INSERT INTO "kobo_bookmark" ("id", "kobo_reading_state_id", "last_modified", "location_source", "location_type", "location_value", "progress_percent", "content_source_progress_percent")
SELECT "id", "kobo_reading_state_id", "last_modified", "location_source", "location_type", "location_value", "progress_percent", "content_source_progress_percent" FROM main."kobo_bookmark";

INSERT INTO "kobo_statistics" ("id", "kobo_reading_state_id", "last_modified", "remaining_time_minutes", "spent_reading_minutes")
SELECT "id", "kobo_reading_state_id", "last_modified", "remaining_time_minutes", "spent_reading_minutes" FROM main."kobo_statistics";

INSERT INTO "user" ("id", "name", "email", "role", "password", "kindle_mail", "locale", "sidebar_view", "default_language", "denied_tags", "allowed_tags", "denied_column_value", "allowed_column_value", "view_settings")
SELECT "id", "name", "email", "role", "password", "kindle_mail", "locale", "sidebar_view", "default_language", "denied_tags", "allowed_tags", "denied_column_value", "allowed_column_value", "view_settings" FROM main."user";

INSERT INTO "flask_settings" ("id", "flask_session_key")
SELECT "id", "flask_session_key" FROM main."flask_settings";

INSERT INTO "user_session" ("id", "user_id", "session_key", "random", "expiry")
SELECT "id", "user_id", "session_key", "random", "expiry" FROM main."user_session";

INSERT INTO "kobo_synced_books" ("id", "user_id", "book_id")
SELECT "id", "user_id", "book_id" FROM main."kobo_synced_books";

INSERT INTO "thumbnail" ("id", "entity_id", "uuid", "format", "type", "resolution", "filename", "generated_at", "expiration")
SELECT "id", "entity_id", "uuid", "format", "type", "resolution", "filename", "generated_at", "expiration" FROM main."thumbnail";

