Database disappear in prod and rolled back 3 months ago in dev

Wappler Version : 4.7.3
Operating System : macOS BigSur - Version 11.6
Server Model: NodeJS
Database Type: Postrgee 11.1.X
Hosting Type: Docker (AWS EC2)

Expected behavior

My WebApp under construction was running perfectly on Localhost

Actual behavior

What actually happens?
I ended working on a page coding last scripts and forms. Everything was OK.
I GitHubed my project.
I reopenned my project to look after my remote target settings because i had no DB…
DB disapeared form my remote target and rolled back to first version (3 months ago) on my Development target.

How to reproduce

I have no idea what happened and can’t work anymore on my project.
Should I create a new “fresh” project using my GitHub files?
Don’t know how to do that (never done before)?
I GitHubed my work every days…
Should I re-install Wappler before?

Many thanks for your feedback.
Sylvain

I tried creating a new project importing files from github.
I recoverd my db in Development target, but can’t connect and fetch data.


DB seems to be empty…

Thanks for your help.

Hi,

Have you clicked the Deploy button? To start the local DB server

Thanks for your answer.
Yes, I did it.
Then tried removing my container and Deploying one more time.
Opening project I could see ma database but facing many troubles like empty tables, or impossible to fetch data.
I closed the project and Wappler and relaunched it… My database rolled back one more time.

You need to do this too:

Thanks for your answer. I already tried with no result both with “Changes” and “Seeds”.

Don’ know how to proceed.
I think there are some old “hidden” setting files in my repo that generate “conflicts”…

Hi Sylvain,

No problem, hope we can get this working so you can get back to work

Can you show a screenshot showing your all your Changes on the Database Manager?

It seems it’s trying to alter a table/relation that does not exist, so I need to see if you’re creating the table/relation in first place

Those are Migrations, they re-create your database schema from files called “migrations”. Have you edited your database schema outside Wappler? Wappler only generates migrations for structure changes made within Wappler

Hi @Apple,
Sorry I was off yesterday. I can see the migrations change panel and did not modify db schema outside of Wappler Database Manager.
The problem is my DB rolled back automaticaly…

I’m about to try starting from a new fresh project and adding db.json, scripts, layout and pages…

UP…
Tried several things since this morning…
Each time I re-ran my project the .wappler/targets/Development/databases/db.json file is reseted.
Some time by deleting dockers container, restarting wappler and copying the git db file I can load a 80% DB… with tables missing.
I checked on GitHub the same db.json file and some tables are empty, of course they should not and were not when i did back-up the project (everything worked perfectly).


I don’t know why this happened… upload troubles during the push request… or troubles with wappler before the push or deploying operation.
By the way, i’ll find the altered tables, kill them and recreate them through the Database Manager… :crossed_fingers:

@George I think this user needs your help, he says he’s indeed using migrations but has no idea why DB has rolled back 3 months and stuff

1 Like

Are you deleting your remote docker database container? Then you are actually throwing away your complete database and on a new deploy a new database is created… which is of course initially empty.

Hi @George,
Thanks for your answer.
I tried different things in different orders trying to get a project with both correct files and DB.

At the very first time > I just ended up my daily tasks with succes and decided to gilthub my files > then my project was down > Since I realised the db.json file I GitHubed is altered with tables missing just like my local file was when I realised my project was not running well…

Since, i’m looking for a solution…
New project + copy pasting file and script?
New DB file from my back-up + correction?
New project importing from GitHub?

I’ve tested a lot of things today…
And nothing work

Even creating a fresh “hello world” project with NodeJS and 3 testing tables
Can’t backup and create the DB from dev to AWS Docker remote
Can’t use the changes files that are not listed
DB infos come with connexion alerts icons…
Tryed several times with brand new hello world projects… and differents versions settings (nodes and Postgree)… Neither MySQL…
Can’t do anything…
Il’ll try to re-install Wappler.

You should know that you have separate databases per target. So your local development database is not the same as your live AWS database. They have their own data and structure.

When you deploy from local to your remote target - then you can also reapply the local database changes in the database manager to the remote live database. So this is how your sync up your changes.

The database data however is never synched or saved on github - it is just created in the database your are working on.

Thanks for your answer.
Agree with 2 target / 2 db structures and data.
In my case, because the project is still in dev they have (or should have) the same structure. only testing data for the moment.

My problem is not about data, i can’t even sync up / deploy structure and db changes from local to remote. The remote DB does not seems to synch up from the backup file.

  • My changes files are not listed in remote view > and I can’t apply them.

I spend the entire day trying with different brand new project (and settings) before posting.

Maybe this video will help:

but your actually need just to switch to the remote target and then reapply the database changes there.

thanks for the video, but I can’t access.

but your actually need just to switch to the remote target and then reapply the database changes there.

sure, that’s what I understood and like in Wappler (and lot of other things :slight_smile: )

Hi everyone…

I’m really sorry, but this video was stored in my Zoom account which I downgraded last month as I hadn’t been using it so much, and I’ve now realised that it has caused this video to no longer be available.

I’ll upgrade the account again in a few month’s time, and hopefully it will reappear!

Sorry about this,
Antony.

No worries, Antony. I will also put this as a tutorial in Wappler docs, so that it shows how to deploy your local database changes to the remote one.