backup db file

This commit is contained in:
Andras Bacsai
2023-07-17 15:17:18 +02:00
parent de4efbb555
commit 3ba44a1e23

View File

@@ -120,6 +120,8 @@ async function reEncryptSecrets() {
await execaCommand(`echo "COOLIFY_SECRET_KEY_OLD_${date}=${secretOld}" >> .env`, {
shell: true
});
console.log(`Backup database to /app/db/prod.db_${date}.`);
await execaCommand(`cp /app/db/prod.db /app/db/prod.db_${date}`, { shell: true });
const transactions = [];
const secrets = await prisma.secret.findMany();
if (secrets.length > 0) {