Backup feed emoncms 8.4.0

No - only part. The MySQL database holds only the metadata - information about the structure of the databases. The data is in the PHPFINA and PHPTIMESERIES files.
I was going to give a link to a section in ‘Learn’ where the databases were explained - but it has disappeared.

The PHPFINA database assumes the data arrives at exact and regular intervals. The time for each item is not recorded, it is calculated knowing the start time of the database, the interval and the record number where the data is stored.

The PHPTIMESERIES database is different, it does store the time that the data arrived and was stored. It is suitable where you need to know the exact time that a piece of data relates to, or where the data arrives at irregular intervals.

[I hoped someone who knew the details better than I do would answer your question.]

thanks for the valuable information.
On the Altervista forum they write about the copy of the database:

"Simply from the phpmyadmin panel you have to go to export, select in sql and copy the code. To import or import the .sql file with the code previously copied or click on the sql button and paste the code you copied when you did the operation export. "

I entered the “VAR” folder of Emoncms840, inside I find the 4 folders as shown in the photo, only those circled have many files inside.
I copy the contents of those two folders inside the same Emoncms10 folders (I wouldn’t want to be wrong but, it seems to me that they are in a bit different paths, just to clarify).

Now, a consideration:
On emoncms10 (the new one) I have already put a new arduino that sends the same feeds for a week or more (in practice I have replicated the same arduino that sends the feeds on the old version).
Could it be possible that you just need to copy only the folders without touching mysql?
Maybe I’m answering myself … No … because the feeds are the same but they have different feed numbers …?

I am writing this, not for fear of losing the data on Emoncms10 (so I have them on the old always updated because it is still working), but for fear of blocking its operation and having to reinstall everything (you have no idea how much time I lost for understand how to get it going and modify the various paths for permissions …)

Obviously I understand that it is at my own risk but I prefer to be aware of what I am going against (since yesterday I have been reading about many errors to export mysql on altervista …)

and anyway … Good day everyone!

Hello

Hello @fipetto

It would be good to clarify if you do have phpfina and phptimeseries feeds on your system and where they are stored… Can you locate the emoncms directory? in that directory there is a settings.php file, you should see a feed_settings section and a couple of directories listed there telling us where your phpfina and phptimeseries directories are located.

You can then try copying these using some kind of file manager, perhaps first to your local computer before uploading to the new server.

For the SQL yes phpmyadmin is probably your best bet. Try that and see how far you get.
It wont be possible easily to preserve your new data on the new server.

All this said, it may be easier to start from scratch and just keep your new server how it is, Im not sure if we are going to hit some stumbling blocks copying the data across, it may work fine but I cant be sure.

The background documentation that Robert mentioned on the feed engines and how they work can be found here: https://github.com/emoncms/emoncms/#design

oops I forgot to insert the photos.
On a photo you can see the path you write on the settings.php file which actually corresponds to the ‘VAR’ folder and inside contains the data only in the folders marked.

Uploading: Screenshot_2022-10-28-10-52-48-155_com.android.chrome.jpg…
Uploading: IMG_20221028_072358.jpg…
Uploading: IMG_20221028_072330.jpg…
Uploading: IMG_20221028_072248.jpg…

The photos don’t seem to have uploaded for some reason… could you try again?

ok




Great, you want to copy those phpfina and phptimeseries files across to the new server and then the mysql database as well.

this photo instead highlights the directory of the new emoncms 10.

but the files that I find inside the ‘phpfina’ and ‘phptimeseries’ folders of emoncms10 I have to delete them right?

and if this is true, should I reset the mysql database?

and then restore the mysql backup file of emoncms8?

quietly treat me as a child who has just seen a computer :wink: but I prefer to have all the steps to take than to take some things for granted and then discover bad news …

1 Like

yes that’s all correct

ok thanks, so if I can try tonight, or in any case this weekend I try to find some time to try.
Then I warn you about the outcome and / or problems.
bye Bye

Hi, here I am …
I blocked everything! :frowning:

First of all I backed up both emoncms with filezilla.
Then I backed up the two databases.

Then I deleted the files in the ‘phpfiwa’ and ‘phptimestore’ folders of emoncms10 and copied the respective files of emoncms8 inside

Deleted the mysql database of emoncms10 and loaded the database of emoncms8 (and it loaded it correctly without giving me any error)

Crossed my fingers and tried to open the page of Emoncms10 and it gives me a nice series of errors and that’s it … the ones that I have attached (for me it is Arabic …)

Help…

in the meantime I try to put everything back as before, hoping it will work again …

PS: I noticed that in emoncms8 the folders with the files are ‘phpfina’ with files like '11 .meta, 115.meta, 115_0.dat, 115_1.dat … etc ‘and’ phptimeseries ‘with files like’ feed_37 .myd, feed_38.myd … etc ’

while in emoncms10 the folder with the data was only ‘phpfina’ with data like '35 .dat, 35.meta, 36.dat, 36.meta … etc ’

the files are different … could this be a problem?

Sorry, but we no longer use the FIWA (Fixed Interval With Averaging) database.

I don’t think @TrystanLea noticed you have both PHPFINA and PHPFIWA data. This is definitely a question for him.

sorry, a clarification, I wrote something wrong.
Emoncms8 has files inside the ‘phpfiwa’ and ‘phptimeseries’ folders.
Emoncms10 originally (before copying folders) had files inside the ‘phpfina’ folder only

however after returning the folders as they were before and importing the original database, emoncms10 resumed working as before.

Hello @fipetto

There is a php script to convert phpfiwa to phpfina but I doubt that will be of use with your system, here it is just in case (usefulscripts/phpfiwa_to_phpfina.php at master · emoncms/usefulscripts · GitHub).

Im afraid you are much more limited in what you can do on a shared server or xampp environment - emoncms is really not designed for use on these environments. All I can really suggest is that you find a suitable VPS and install emoncms there using EmonScripts so that you can run these scripts. Here’s an example that’s super cheap £1/month!! VPS Hosting UK | Windows & Linux | Cheap » from £1/mth (I havent tried Ionos myself I’ve only tried DigitalOcean).

I understand…
I ask you a question that I asked at the beginning hoping that google translates it well …
With arduino I send data to emoncms, and when I need it I also go to read some feeds.
Is there a possibility to read a feed on a certain date and not the last one sent?
I had read about the “timestamp” but sending some commands I do not receive anything …
I am not sure how it works and if it works.
But as I hope, if I can get a feed value from the “past” I would try to send it to the new emoncms with the same date so that it updates the graph backwards …? could it be an idea?

For example, here I am trying to write this command:

http://mimmos.altervista.org/emoncms/feed/insert.json?id=35&time=1634731215&value=1000

I am answered ‘1000’ every time I try to send it from the browser (obviously after logging in), I also tried to send it with unix timestamps with intervals of 5/10 seconds, but then looking at the graph of the feed 35 I do not see any written data .
The timestamp refers to the date October 20, 2021 2:00 pm when emoncms was not yet running.

Am I doing something wrong?
I would expect from this test to see some data in the graph setting the same date …
Maybe I have to send many times

hello, it’s always me who is doing some tests in my spare time.
I don’t know if I discovered hot water :wink: but, working with the timestamp, I can only enter data after the creation date of the first feed! So I can’t go back in time (as I hoped) …
So I tried to create a new feed by inserting the timestamp of November 2, 2015 in the ‘get’, and this worked, in fact in the feed graph I can see the collected samples …
So if this condition continues to work, I should delete all emoncms10 feeds (the new one to be clear), then with arduino go to read the feeds registered on emoncms840 with timestamp from where the registration starts (it seems to me in the year 2015) and send data with the same timestamp at emoncms10 … I think it should go … it will be a bit long to do, but not that much …

what are you saying? is it crazy ??

:slight_smile: yes you could try that… definetly not the most efficient approach but it should work.

Out of interest why do you prefer to continue with an altervista hosting when you could get a full VPS for around the same amount and use our standard installation procedure? and as a result get access to the tools that you need to transfer the data?

for the moment altervista is free, and since the idea is to move everything to my house on a raspberry, I approached this way to see if the project worked … and years have passed since then …