database full

Post Reply
alexvanuxem
Forecaster
Forecaster
Posts: 182
Joined: Mon Jan 31, 2022 4:41 pm
Location: Sint-Katelijne-Waver, Belgium
Station model: Davis Vantage Pro 2
Software: Meteobridge
Contact:

database full

Post by alexvanuxem » Sun Feb 05, 2023 5:01 pm

hi all,

my provider has a limit set on his sql database size.

I have only acces to 100mb of data, but I can add 4 of those, seems to be a little 'kafka'. :-)

i switched to a new one, but yes my old data are 'gone' but still available , only not viewable in MT..

Is there a way in MT to load multiple sql's, but only write to the newest?

thx!!
Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: database full

Post by davidefa » Sun Feb 05, 2023 5:57 pm

I'd say it can't be done
Image

FSC830
Forecaster
Forecaster
Posts: 139
Joined: Thu Aug 02, 2018 11:40 am
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: database full

Post by FSC830 » Sun Feb 05, 2023 6:15 pm

No, without a complete redesign and rewriting not.
There is only one DB given in main setup and referred in subsequent PHP pages.
So without a major redesign its not possible.

Best chance for a short term solution is may be to move to a different provider (i.e. Strato has a DB limit of 2 GB).
But as far as I remember my database contains data of the last 6 years and is not larger than 55 MB.

Regards
Image

alexvanuxem
Forecaster
Forecaster
Posts: 182
Joined: Mon Jan 31, 2022 4:41 pm
Location: Sint-Katelijne-Waver, Belgium
Station model: Davis Vantage Pro 2
Software: Meteobridge
Contact:

Re: database full

Post by alexvanuxem » Tue Feb 07, 2023 12:16 pm

i can upgrade to more storage up to 500MB.

but now i have one full of 100MB database and started a second.

If I upgrade can I easily import the second into the first?
Both have the same alldata and allextradata folders and fields.
So I have again one complete databse?
I don't have a clue to do this?

Many thx!
Image

FSC830
Forecaster
Forecaster
Posts: 139
Joined: Thu Aug 02, 2018 11:40 am
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: database full

Post by FSC830 » Tue Feb 07, 2023 7:46 pm

Yes, this is possible. But you need to take care, when using a wrong command, you will overwrite the database!
Best is, to create a database dump of both databases in advance.

Next you need to import only the data, not the schedule/metadata from the second database.
I did this a few days ago in my test environment.

Regards

Edit: Some more details about importing:
1. make a backup of each database!
2. make another backup ;) !
3. Consider the "full" and enlarged database is DB_A, the "new" database is DB_B.
4. Make a dump from DB_B and edit the dumped files. From host CLI:

Code: Select all

mysqldump -u username -p DB_B > dumpfile.txt
5. It must (!) contain only the data -> remove all lines in the dump output except the line starting with

Code: Select all

INSERT INTO `alldata` VALUES
. This line ends with a

Code: Select all

;
.
6. Open your "full" database

Code: Select all

mysql -u username -p
and select the database

Code: Select all

use DB_A
.
7. Paste the line from #5 and press enter
8. Check with

Code: Select all

select * from alldata;
or

Code: Select all

select * from alldata where year(datetime)=2023;
if all values are now in the database.

Regards

alexvanuxem
Forecaster
Forecaster
Posts: 182
Joined: Mon Jan 31, 2022 4:41 pm
Location: Sint-Katelijne-Waver, Belgium
Station model: Davis Vantage Pro 2
Software: Meteobridge
Contact:

Re: database full

Post by alexvanuxem » Wed Feb 08, 2023 3:36 pm

thanks

and done!

I have 1 database again!

cheers
Image

Post Reply