database migration from sqlite to postgres

Signed-off-by: philippe lhardy <philippe.lhardy@astrolabe.coop>
This commit is contained in:
2025-08-18 09:46:24 +02:00
parent 7408912bd5
commit b7db03be76
5 changed files with 82 additions and 5 deletions

View File

@@ -7,7 +7,29 @@ bind_folder=$(pwd)/$rel_bind_folder
timestamp=$(get_timestamp_second)
database_file=/data/owncloud.db
database_dest=nextcloud.${timestamp}.db
$defer sudo cp ${bind_folder}${database_file} ${database_dest}
$defer sudo chown $(id -u):$(id -g) ${database_dest}
getsqlite()
{
database_file=/data/owncloud.db
database_dest=nextcloud.${timestamp}.db
$defer sudo cp ${bind_folder}${database_file} ${database_dest}
$defer sudo chown $(id -u):$(id -g) ${database_dest}
}
getmysql()
{
BACKUP_FILE=nextcloud.${timestamp}.mysql
database_dest=nextcloud.${timestamp}.db
ssh ${SSH_URL} 'mysqldump -u adminmyweb -p nextcloud --single-transaction --quick --lock-tables=false' | cat > ${BACKUP_FILE}
}
getpostgresql()
{
./backup_sql.sh
}
log_warn "NO check if sqlite was migrated... so might get unused information"
getsqlite
getpostgresql