def METHOD_NAME(file_from, file_to, date, keep_timestamp_utc):
	conn_to = sqlite3.connect(file_to, isolation_level='EXCLUSIVE')
	cursor_to = conn_to.cursor()
	conn_from = sqlite3.connect(file_from, isolation_level='EXCLUSIVE')
	conn_from.text_factory = lambda b: b.decode(errors = 'ignore').rstrip()
	for line in conn_from.iterdump():
		cursor_to.execute(line)
	for table in TABLES:
		cursor_to.execute(f'INSERT INTO {table} SELECT * FROM {table}_backup WHERE Timestamp < DATETIME("{date}", "utc")')
	cursor_to.close()
	conn_to.commit()
	cursor_from = conn_from.cursor()
	for table in TABLES:
		if sqlite_table_exists(cursor_from, table):
			cursor_from.execute(f'DELETE FROM {table}')
		backup_table = f'{table}_backup'
		if sqlite_table_exists(cursor_from, backup_table):
			cursor_from.execute(f'DELETE FROM {backup_table} WHERE Timestamp < DATETIME("{date}", "utc")')
	cursor_from.close()
	conn_from.commit()
	conn_from.close()
	cursor_to = conn_to.cursor()
	# delete non-moved backup-rows:
	for table in TABLES:
		backup_table = f'{table}_backup'
		if sqlite_table_exists(cursor_to, backup_table):
			cursor_to.execute(f'DELETE FROM {backup_table}')
	if not keep_timestamp_utc:
		# change date from utc to wanted current timezone for mysql https://github.com/ddnet/ddnet/issues/6105
		for table in TABLES:
			cursor_to.execute(f'''
				UPDATE {table}
				SET Timestamp = DATETIME(original.Timestamp, "localtime")
				FROM (
					SELECT rowid, Timestamp FROM {table}
				) as original
				WHERE {table}.rowid = original.rowid''')
	cursor_to.close()
	conn_to.commit()
	for line in conn_to.iterdump():
		print(line.encode('utf-8'))
	conn_to.close()