IRC logs for #farmOS, 2019-11-08 (GMT)

2019-11-07
2019-11-09
TimeNickMessage
[19:01:58]<mstenta[m]>That's correct
[19:02:35]<mstenta[m]>But locale module needs to be installed, and languages need to be enabled on the site first
[19:02:55]<mstenta[m]>And on general farmOS isn't translated into most languages yet
[19:06:04]<paul121[m]>Ahh okay. Neat
[19:06:28]<paul121[m]>Just wanted to check that out. Some "common" words would get translated, right?
[19:32:26]<mstenta[m]>Yea exactly, translations are downloaded from localize.drupal.org
[19:32:46]<mstenta[m]>So a lot of common strings are already there
[21:18:13]* FijiDave_ has joined #farmos
[21:20:08]* FijiDave has quit (Ping timeout: 276 seconds)
[00:05:29]* FijiDave has joined #farmos
[00:07:50]* FijiDave_ has quit (Ping timeout: 276 seconds)
[02:23:00]* JustTB has joined #farmos
[02:27:01]* JustTB has quit (Read error: Connection reset by peer)
[02:46:02]* JustTB has joined #farmos
[03:44:30]* JustTB has quit (Quit: Leaving.)
[08:03:47]* JustTB has joined #farmos
[10:56:34]* JustTB has quit (Quit: Leaving.)
[13:28:56]<skipper_is[m]>All sorts of issues, grumping that there are 2 primary keys, formatting that was different between PostGres and MySQL...
[13:29:03]<skipper_is[m]>Me being an idiot and not installing all the same things...
[13:30:07]<skipper_is[m]>Going to drop all tables and reinstall
[13:30:45]<mstenta[m]>Ok yea - worth another shot!
[13:30:46]<mstenta[m]>:-)
[13:30:49]<mstenta[m]>ACTION sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/hWhvJDorAYhWiNnr... >
[13:31:27]<skipper_is[m]>Yea, yea, I know, I know
[13:31:43]<skipper_is[m]>Had to recreate a bunch of tables from the postgresql definition
[13:31:57]<skipper_is[m]>And try and figure out what the MySQL equivelant was for some data types
[13:33:14]<skipper_is[m]>I've got the college principle onboard with me rolling out FarmOS on their systems
[13:33:29]<mstenta[m]>I wouldn't think you'd need to mess with data types at all
[13:33:40]<skipper_is[m]>Couldn't find a TEXT type in MySQL
[13:33:42]<mstenta[m]>As long as you're ONLY doing `INSERT` statements in the dump...
[13:34:02]<skipper_is[m]>Yea, the issue was that some tables didn't exist, because I hadn't installed that module
[13:34:06]<mstenta[m]>You should not be creating any tables in the dump
[13:34:22]<mstenta[m]>Right... so the best way to do it is to install the modules
[13:34:24]<mstenta[m]>Drupal will take care of that for you
[13:34:50]<skipper_is[m]>Yea, I know, I was just trying to be quick yesterday and skip the installation of them...
[13:34:53]<skipper_is[m]>And ended up taking much longer than intended
[13:36:36]<mstenta[m]>Haha yup yup
[13:36:51]<skipper_is[m]>But there are also some statements that are different, or rather the formatting is diffferent
[13:36:59]<skipper_is[m]>For example, timestamp as a column name
[13:37:07]<mstenta[m]>Oh yea? Curious
[13:37:12]<skipper_is[m]>In Postgresql, because timestamp is a function, it "timestamp"s it
[13:37:31]<mstenta[m]>Oh... gotcha
[13:37:32]<skipper_is[m]>And MySQL wasn't happy about some column names being in "
[13:37:36]<mstenta[m]>That's good to know.....
[13:37:48]<mstenta[m]>What table(s) is that in? Can you see easily?
[13:37:53]<skipper_is[m]>It is a simple find/replace I know
[13:37:53]<mstenta[m]>{log}
[13:37:54]<mstenta[m]>Others?
[13:38:06]<skipper_is[m]>I just couldn't be bothered with it at 11pm and a 5am start..
[13:38:43]<skipper_is[m]>MySQL didn't seem to like emojis in notes..
[13:38:53]<skipper_is[m]>I gave up about 25% through all the insert statements, so possibly
[13:39:40]<skipper_is[m]>There are some headers on the pgsql dump, which MySQL doesnt like
[13:39:49]<skipper_is[m]>Its like 10 lines that just ned removing
[13:42:18]* farmBOT has joined #farmos
[13:42:27]<skipper_is[m]>I've got as many logs in there as I do sensor readings.... Which is about 20k
[13:42:47]<mstenta[m]>Watchdog should get pruned automatically if you have cron configured... but you can also just truncate it manually
[13:43:28]<skipper_is[m]>Yea, my cron is playing silly buggers
[14:07:19]<skipper_is[m]>Right, fresh install done
[14:07:22]<skipper_is[m]>All modules installed..
[14:07:26]<skipper_is[m]>Lets truncate all that hard work!
[14:08:57]<mstenta[m]>Haha
[14:09:25]<mstenta[m]>after you do that, you might want to take a quick snapshot of the empty databases
[14:09:28]<mstenta[m]>are you doing this in docker, perchance?
[14:09:47]<skipper_is[m]>I am not
[14:10:22]<skipper_is[m]>Oh.
[14:10:29]<skipper_is[m]>Table 'farmos.farm_grazing_animal_types' doesn't exist
[14:10:41]<mstenta[m]>Oh
[14:10:46]<mstenta[m]>Yea...
[14:10:51]<mstenta[m]>:-(
[14:10:59]<skipper_is[m]>It didn't clean up after itself XD
[14:11:21]<mstenta[m]>Ooooh!
[14:11:41]<mstenta[m]>Right. You didn't uninstall the module
[14:11:50]<mstenta[m]>Disabling doesn't clean up... uninstalling does
[14:12:02]<skipper_is[m]>Aah
[14:12:14]<skipper_is[m]>I'll just remove all references to it I can find...
[14:12:28]<mstenta[m]>There may be other tables
[14:13:10]<skipper_is[m]>There are a couple
[14:13:19]<skipper_is[m]>Have removed them too
[14:13:31]<skipper_is[m]>There are references to it in other tables, but if they're not called, shouldn't matter
[14:13:40]<skipper_is[m]>Duplicate entry 'farm_map_kml_action' for key 'PRIMARY'
[14:13:46]<mstenta[m]>:-/
[14:13:55]<mstenta[m]>Well that suggests you didn't truncate
[14:14:14]<skipper_is[m]>Weird...
[14:14:20]<skipper_is[m]>I'll truncate the lot again...
[14:14:50]<mstenta[m]>You would need to truncate again after `Table 'farmos.farm_grazing_animal_types' doesn't exist`
[14:15:02]<skipper_is[m]>Yea, just realised that :)
[14:15:09]<mstenta[m]>I'll be honest I don't love that there will be messy stuff left over from the grazing module
[14:15:13]<skipper_is[m]>It doesn't rollback on failure
[14:15:25]<mstenta[m]>If you ever try to install it again in the future, it may throw errors
[14:15:42]<mstenta[m]>Or cause weird issues
[14:15:56]<skipper_is[m]>I'll burn that bridge when I come to it
[14:16:01]<mstenta[m]>lol
[14:16:18]<mstenta[m]>you're assuming that I'll help you burn it I think ;-)
[14:16:25]<mstenta[m]>don't say i didn't warn you ;-)
[14:16:29]<skipper_is[m]>:P
[14:17:14]<skipper_is[m]>This is just a test run really, rather than migrating it to my new server (If they give it to me...)
[14:17:23]<mstenta[m]>alternatively... you could open up your farmOS running on postgres, uninstall it (and any other modules you may have disabled but not uninstalled), and then re-dump
[14:17:25]<skipper_is[m]>So I can do a clean up of the grazing module prior to that
[14:17:34]<mstenta[m]>ok cool cool
[14:18:24]<skipper_is[m]>I'll do that now while I remember
[14:19:14]<skipper_is[m]>Ah nuts, I meant to inject a goat today... It was right there on my upcoming tasks list as well
[14:19:21]<skipper_is[m]>..brb...
[14:19:26]<mstenta[m]>haha
[14:19:38]<mstenta[m]>(we need notifications in field kit)
[14:19:46]<mstenta[m]>jgaehring: ^!
[14:20:05]<mstenta[m]>:-)
[14:20:38]<skipper_is[m]>I had to uninstall mine, it kept refusing to sync on the phone, so I'd have to relog, but that removed the log I was trying to sync..
[14:20:42]<skipper_is[m]>Probably a Postgres issue...
[14:20:57]<mstenta[m]>oh right
[14:21:03]<mstenta[m]>well worth testing again after you migrate
[14:22:22]<jgaehring[m]>> (we need notifications in field kit)
[14:22:23]<jgaehring[m]>haha, yea!
[14:22:51]<mstenta[m]>i had a similar thought the other day when i realized my dog was past due for heartworm pill
[14:23:00]<mstenta[m]>it was in my late tasks :-)
[14:27:10]<skipper_is[m]>All of mine, apart from that one, are late tasks...
[14:27:49]<skipper_is[m]>The dates are just the dates I created them.. Like "Broken gate"... I have no idea when I'm going to fix that.... Just wanted to make a note to make myself feel better
[14:27:55]<skipper_is[m]>Out of range value for column 'value_denominator' at row 1
[14:28:07]<skipper_is[m]>....Flipping sensors
[14:28:20]<mstenta[m]>hmm any more details on that one?
[14:28:23]<mstenta[m]>full error?
[14:29:24]<skipper_is[m]>ERROR 1264 (22003) at line 10819 in file: '/home/dcaplin/farmosbackup.sql': Out of range value for column 'value_denominator' at row 1
[14:29:34]<skipper_is[m]>Pseudo precision on the average temperature
[14:29:36]<skipper_is[m]>INSERT INTO farm_sensor_data (id, timestamp, name, value_numerator, value_denominator) VALUES (97, 1571686056, 'Temperature Average', 93171052631579, 10000000000000);
[14:29:39]<skipper_is[m]>Is the line
[14:30:34]<mstenta[m]>`10000000000000` is the denominator in that...
[14:30:53]<mstenta[m]>can you look at the mysql schema for that table?
[14:31:10]<skipper_is[m]>Doing so now
[14:31:14]<skipper_is[m]>Ah
[14:31:26]<skipper_is[m]>Yea, there it is
[14:31:42]<mstenta[m]>is it because it's unsigned?
[14:31:43]<skipper_is[m]>numerator is Bigint(20)
[14:31:48]<skipper_is[m]>denominator is int(10)
[14:32:08]<skipper_is[m]>No, unsigned would've been fine...
[14:32:13]<skipper_is[m]>It is only a 10 digit int
[14:32:35]<mstenta[m]>ok.... but....
[14:32:37]<skipper_is[m]>That is a 15 digit number
[14:32:42]<skipper_is[m]>10000000000000
[14:32:43]<mstenta[m]>i don't think we can do a bigint for that
[14:32:52]<skipper_is[m]>No?
[14:32:52]<mstenta[m]>hold on one sec...
[14:33:11]<skipper_is[m]>Surely the type should be the same as the numerator?
[14:33:27]<mstenta[m]>how the heck did you get that value into postgresql?
[14:33:37]<skipper_is[m]>Because postgresql isn't using bigint
[14:33:50]<skipper_is[m]>I don't even think that is an available datatype
[14:34:05]<mstenta[m]>did you do something manually to allow it?
[14:34:11]<skipper_is[m]>I'll get you the schema from postgresql now
[14:34:23]<skipper_is[m]>Nope, I think it is using a different data type
[14:34:44]<skipper_is[m]>Well, I'll tell you in just a moment
[14:35:07]<skipper_is[m]>Ahhh
[14:35:13]<skipper_is[m]>They're both set to bigint in postgresql
[14:35:22]<mstenta[m]>that shouldn't be
[14:36:01]<skipper_is[m]>ACTION uploaded an image: image.png (58KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/oKdAlHLrxNZNtWys... >
[14:36:02]<skipper_is[m]>I haven't touched anythign
[14:36:02]<mstenta[m]>stop finding bugs with postgresql skipper_is !!!
[14:36:03]<mstenta[m]>lol
[14:36:12]<mstenta[m]>(or rather, bugs with Drupal's postgresql driver
[14:36:36]<skipper_is[m]>Weirdly id is bigint, but in MySQL it is int(10), but timestamp which is int(11) is still just a normal int
[14:37:23]<skipper_is[m]>I'll just set it to bigint in MsySQL as well... and remember to round my averages...
[14:37:24]<mstenta[m]>what the heck
[14:37:37]<mstenta[m]>no wait
[14:37:52]<mstenta[m]>i can't be held responsible for manual overrides! lol
[14:37:57]* JustTB has joined #farmos
[14:38:01]<skipper_is[m]>No fear :)
[14:38:01]<mstenta[m]>there's reasoning behind those decisions... i'm just trying to refresh on that now
[14:38:14]<mstenta[m]>https://www.drupal.org/project/fraction
[14:38:15]<skipper_is[m]>But surely they should be the same datatype?
[14:38:20]<mstenta[m]>that's the module that defines those
[14:38:23]<mstenta[m]>no
[14:38:24]<mstenta[m]>they shouldn't
[14:38:31]<mstenta[m]>maybe they could be... but that was a decision
[14:38:42]<mstenta[m]>> This means that for price storage, this module supports up to 9 decimal places of precision (because the maximum denominator is 4,294,967,295, meaning the highest possible base-10 number that fits into that is 1,000,000,000). Ultimately, the maximum numerator depends on the size of the denominator. But, using the maximum precision (of 9 decimal places), the biggest number this can store is 9,223,372,036.854775807.
[14:39:23]<mstenta[m]>if you go higher with the denominator, it limits how high you can go with the numerator
[14:39:49]<mstenta[m]>which maybe is something we could still allow... but that would require adding logic to prevent certain scenarios
[14:39:51]<skipper_is[m]>yea, but if you go low with the denominator, you lose the precision
[14:40:01]<skipper_is[m]>Which, to be fair, is pseudoprecision anyway
[14:40:29]<mstenta[m]>lol is 9 decimal places not precise enough for you??
[14:41:09]<skipper_is[m]>Not when I've been lazy on my programming!
[14:41:14]<mstenta[m]>hahaha
[14:41:44]<mstenta[m]>well ultimately... this just reveals a different issue entirely... for some reason postgresql is defaulting to bigint when it should be int
[14:42:02]<mstenta[m]>that resulted in you being able to store a value you shouldn't have been able to store
[14:42:40]<skipper_is[m]>Might not do unsigned...
[14:42:55]<mstenta[m]>i'm laughing out loud right now skipper_is - you've managed to find the deepest and most annoying bugs
[14:43:14]<skipper_is[m]>https://www.postgresql.org/docs/9.1/datatype-numeric.html
[14:43:28]<skipper_is[m]>I think I should have some sort of badge for that :P
[14:43:45]<mstenta[m]>i think so!
[14:43:46]<mstenta[m]>haha
[14:44:21]<skipper_is[m]>Urgh, going to have to go through and strip back that pseudo precision from postgresql before importing it into mysql
[14:44:50]<mstenta[m]>yea... that may be the easiest... are you willing to lose some of those decimal places?
[14:44:59]<skipper_is[m]>It is a tough call
[14:45:06]<mstenta[m]>haha
[14:45:13]<skipper_is[m]>I was really counting on having my temperature averages to 15 decimal places
[14:45:22]<mstenta[m]>LOL
[14:45:52]<skipper_is[m]>That 0.000000000000001 degree shift can make a massive difference to grass growth
[14:47:07]<skipper_is[m]>It might be 4.999999999999999c, and I would think that they grass would be growing if it had rounded it up to 5, but grass doesn't grow until 5... And does absolutely nothing 1e-15c below that so i'd be basing all my management decisions on that loss of precision..
[14:47:27]<mstenta[m]>I think if you can manage to just drop the last 4 or 5 digits from both the numerator and the denominator then you'll be able to import it
[14:48:04]<skipper_is[m]>I can probably do that in sql actually...
[14:48:11]<mstenta[m]>Of course, you should also update your sensor at the same time so that it rounds the numbers
[14:48:16]<mstenta[m]>Yea perhaps
[14:48:33]<mstenta[m]>Probably want to update your sensor first
[14:48:39]<mstenta[m]>So that you don't have to keep re-running the SQL to trim new stuff coming in
[14:49:14]<skipper_is[m]>Yea, already done that
[14:49:46]<skipper_is[m]>It wasn't actually the sensor doing it, I was... not smart, but not as daft... there. I've got a python script that runs nightly and just gives me an average for the day
[14:49:47]<mstenta[m]>i'm still baffled as to why you ended up with bigint in the first place...
[14:49:53]<mstenta[m]>https://www.drupal.org/docs/7/api/schema-api/data-types/data-types-overview
[14:49:54]<skipper_is[m]>And it was just dumping that raw average straight in
[14:50:21]<skipper_is[m]>But since it was python, easy fix, round(avgTemp,2) job done
[14:50:45]<mstenta[m]>Yea that makes sense... and it makes me wonder if we need some validation code in farmOS to handle values that are out of range coming from a sensor
[14:51:08]<mstenta[m]>I'm curious what happens if you try to push a big value like that to mysql
[14:51:40]<skipper_is[m]>I'll probably find out XD
[14:51:40]<mstenta[m]>If it rounds it automatically or chokes on it in the db insert... I forget if we have any logic in place for that
[14:52:00]<mstenta[m]>If anyone will - it will be you haha
[14:53:01]<skipper_is[m]>MySQL might have something internal
[14:53:03]<mstenta[m]>> i'm still baffled as to why you ended up with bigint in the first place...
[14:53:03]<mstenta[m]>Let me start up my postgres farmOS test instance and look at my DB... to see if it also has bigint
[14:53:42]<skipper_is[m]>No, it clearly doesnt
[14:53:50]<skipper_is[m]>Otherwise we wouldn't be having this discussion
[14:54:04]<mstenta[m]>Well I haven't tested that specifically in postrges
[14:54:33]<skipper_is[m]>Sorry, my reply got split, sounds like I was calling you out XD
[14:54:48]<skipper_is[m]>MySQL clearly doesn't have an automatic way of dealing with it, otherwise I wouldn't have noticed when I tried to insert that row
[14:54:49]<mstenta[m]>oh gotcha ;-)
[14:55:17]<skipper_is[m]>I've just got terrible internet
[14:55:21]<mstenta[m]>are you familiar with pgsql command line? i don't have the pgadmin tool
[14:55:33]<skipper_is[m]>For dumping?
[14:55:33]<mstenta[m]>it might be riot actually... seems to be a bit laggy
[14:55:55]<mstenta[m]>i want to see the table definition for the sensor table
[14:56:04]<skipper_is[m]>We're running the entire farm off of one 4g wifi dongle
[14:56:27]<skipper_is[m]>Describe table?
[14:56:54]<skipper_is[m]>\d
[14:56:54]<mstenta[m]>yea
[14:56:56]<skipper_is[m]>Then the table name
[14:57:09]<mstenta[m]>(i don't even know what the postgres command is to start the prompt though lol)
[14:57:44]<skipper_is[m]>sudo su to the postgres user
[14:57:49]<skipper_is[m]>or whatever your login user is for the db
[14:58:15]<skipper_is[m]>psql
[14:58:54]<mstenta[m]>ok i did `psql -U farm`
[14:59:29]<mstenta[m]>it didn't ask for password
[14:59:40]<mstenta[m]>but i'm in the command line now i think
[15:00:25]<skipper_is[m]>You in the right db?
[15:00:39]<skipper_is[m]>I've got a whole load on one server...
[15:00:49]<mstenta[m]>oh i got it!
[15:01:02]<mstenta[m]>ACTION sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/FyIRPvPvTuAvrZOM... >
[15:01:05]<mstenta[m]>AH HA!
[15:01:07]<mstenta[m]>`bigint`s!
[15:01:14]<skipper_is[m]>Ah! nice one
[15:02:58]<skipper_is[m]>Ok, so it isn't me poking it in the wrong place :P
[15:03:18]<mstenta[m]>no not you!
[15:03:21]<mstenta[m]>you just found it
[15:03:42]<mstenta[m]>and i will still hold that against you ;-)
[15:03:57]<mstenta[m]>i'm searching Drupal queues to see if anyone else has reported this
[15:10:39]<skipper_is[m]>ERROR 1064 (42000) at line 8041 in file: '/home/dcaplin/farmosbackup.sql': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"position", weight, include_file) VALUES ('comment/reply/%', '\x613a313a7b693a32' at line 1
[15:11:03]<skipper_is[m]>It doesnt like emojis
[15:11:47]<mstenta[m]>ah you need to set your mysql collation to...
[15:11:50]<skipper_is[m]>Oh, that is something weird..
[15:12:21]<mstenta[m]>`utf8mb4`
[15:12:21]<skipper_is[m]>menu_router
[15:12:21]<mstenta[m]>https://stackoverflow.com/questions/39463134/how-to-store-emoji-characte...
[15:12:49]<mstenta[m]>It's actually the same reason why using emojis in this chat crashes farmBOT
[15:13:06]<mstenta[m]>i need to update the mysql db that @farm
[15:13:13]<mstenta[m]> * i need to update the mysql db that @farmBOT uses
[15:13:32]<mstenta[m]>wait, was that in menu_router?
[15:13:50]<skipper_is[m]>That is the bit causing the crash
[15:13:51]<mstenta[m]>there shouldn't be any emojis in menu_router
[15:13:55]<skipper_is[m]>It isnt
[15:13:59]<mstenta[m]>oh ok
[15:14:05]<skipper_is[m]>It is:
[15:14:06]<skipper_is[m]>> INSERT INTO menu_router (path, load_functions, to_arg_functions, access_callback, access_arguments, page_callback, page_arguments, delivery_callback, fit, number_parts, context, tab_parent, tab_root, title, title_callback, title_arguments, theme_callback, theme_arguments, type, description, "position", weight, include_file) VALUES ('farm/logs/sales', '\x', '\x', 'views_access',
[15:14:07]<skipper_is[m]>'\x613a313a7b693a303b613a323a7b693a303b733a31363a2276696577735f636865636b5f7065726d223b693a313b613a313a7b693a303b733a33313a227669657720616e79206661726d5f73616c65206c6f6720656e746974696573223b7d7d7d', 'views_page', '\x613a323a7b693a303b733a31333a226661726d5f6c6f675f73616c65223b693a313b733a343a2270616765223b7d', '', 7, 3, 0, '', 'farm/logs/sales', 'Sales', 't', '', '', 'a:0:{}', 6, '', '', 0, '');
[15:14:30]<mstenta[m]>uhh
[15:16:35]<skipper_is[m]>Oh no, it is the line above
[15:16:37]<skipper_is[m]>''INSERT INTO menu_router (path, load_functions, to_arg_functions, access_callback, access_arguments, page_callback, page_arguments, delivery_callback, fit, number_parts, context, tab_parent, tab_root, title, title_callback, title_arguments, theme_callback, theme_arguments, type, description, "position", weight, include_file) VALUES ('comment/reply/%', '\x613a313a7b693a323b733a393a226e6f64655f6c6f6164223b7d', '\x',
[15:16:37]<skipper_is[m]>'node_access', '\x613a323a7b693a303b733a343a2276696577223b693a313b693a323b7d', 'comment_reply', '\x613a313a7b693a303b693a323b7d', '', 6, 3, 0, '', 'comment/reply/%', 'Add new comment', 't', '', '', 'a:0:{}', 6, '', '', 0, 'modules/comment/comment.pages.inc');''
[15:16:40]<mstenta[m]>Hmm
[15:17:00]<skipper_is[m]>I suspect it is the % in the value..
[15:17:01]<mstenta[m]>Hmm
[15:17:27]<mstenta[m]>Those `\x`s are suspicious
[15:18:14]<skipper_is[m]>Can i skip that table? Or is menu_router vital to operation?
[15:19:10]<mstenta[m]>It is vital, but you could skip it if you don't truncate The original MySQL table that farmOS created during install
[15:19:32]<skipper_is[m]>Yea, bit late now :D
[15:19:33]<mstenta[m]>I think that must be a postgres dump thing
[15:20:24]<mstenta[m]>Hmm reading https://stackoverflow.com/questions/9264808/convert-a-postgresql-dump-in...
[15:20:39]<mstenta[m]>Yea this is all very complicated
[15:20:44]<mstenta[m]>Who would have thought
[15:21:03]<skipper_is[m]>Indeed...
[15:21:25]<mstenta[m]>https://github.com/ChrisLundquist/pg2mysql
[15:21:35]<skipper_is[m]>I am thinking that it would be easier to just use FarmOS.py to migrate the assets and logs..
[15:21:51]<mstenta[m]>Found that
[15:22:14]<skipper_is[m]>PostGreSQL is storing the load_functions as a bytea
[15:22:16]<skipper_is[m]>MySQL is storing it as a blob
[15:22:35]<mstenta[m]>Yea...
[15:23:07]<mstenta[m]>I dunno, doing it via api would be possible, but will require a lot more manual linking up of stuff
[15:23:27]<mstenta[m]>Eg: you won't have the same asset IDs when you create assets via API
[15:23:43]<mstenta[m]>So log references would need to be manually updated
[15:23:51]<mstenta[m]>And any other references like that
[15:24:03]<skipper_is[m]>Yea, though could have a 'lookup table' for that
[15:24:09]<mstenta[m]>So here's another idea...
[15:24:19]<mstenta[m]>Yup but that feels like it will be more work
[15:24:36]<skipper_is[m]>I dunno.. this is a fair bit of work XD
[15:24:36]<mstenta[m]>Although this hasn't been easy either haha
[15:25:16]<mstenta[m]><mstenta[m] "So here's another idea..."> I could tell you which tables to import
[15:25:38]<skipper_is[m]>Yea
[15:25:44]<mstenta[m]>And you could JUST dump/truncate/import those
[15:25:55]<skipper_is[m]>Rather than just truncating them all, that works
[15:25:56]<mstenta[m]>Might avoid some issues
[15:26:01]<mstenta[m]>Yes
[15:26:25]<skipper_is[m]>There are like 244 tables..
[15:26:44]<mstenta[m]>Can you paste a list of all your current tables into a gist or pastebin and send to me?
[15:26:53]<mstenta[m]>I'll copy and remove all the ones you don't need to worry about
[15:27:17]<skipper_is[m]>I can indeed
[15:29:25]<skipper_is[m]>ACTION posted a file: data-1573244929835.csv (24KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/hEyyNewQOTKtnFlU... >
[15:30:14]<mstenta[m]>standby
[15:33:34]<mstenta[m]>https://pastebin.com/SZ264zVa
[15:33:43]<mstenta[m]>that pastebin expires in 24 hours fyi, so copy it
[15:33:50]<mstenta[m]>those are the tables you need
[15:34:12]<skipper_is[m]>Ah nice one
[15:34:18]<mstenta[m]>(note: this assumes you haven't done any customizations to farmOS, aside from adding content to it)
[15:35:31]<skipper_is[m]>Ok, I'll reinstall and give it a try
[15:37:01]<mstenta[m]>i made this issue so i can follow up on the `bigint` thing: https://github.com/farmOS/farmOS/issues/213
[15:42:08]<mstenta[m]>alright well - i need to go move some firewood
[15:42:19]<mstenta[m]>let me know how that goes for you
[15:42:36]<mstenta[m]>tip: take a snapshot of the MySQL database after you install farmOS, so that you don't have to go through the whole install process again in the future
[15:42:51]<mstenta[m]>(and remember to uninstall the grazing module (and others) before you dump)
[15:43:48]<mstenta[m]>oh... one other thought came to mind... regarding the `bytea` vs `blob`...
[15:44:00]<mstenta[m]>as far as I know, there is only one piece of farmOS data that might be stored as `bytea`/`blob` in the database...
[15:44:12]<mstenta[m]>geofields
[15:44:46]<mstenta[m]>so you should look in the table `field_data_field_farm_geofield` (as well as `field_revision_field_farm_geofield`)
[15:44:50]<mstenta[m]>that is where that will be
[15:45:56]<mstenta[m]>so you might run into that as an issue again... you might need to figure out how to dump those differently...
[15:56:24]<skipper_is[m]>Well, I can always just have them as non-geometry features, and then add the geometry from WKT
[16:02:11]<mstenta[m]>skipper_is: I just realized I had opened an issue for this a while ago already... https://www.drupal.org/project/fraction/issues/2729315
[16:02:22]<mstenta[m]>(not exactly the same, but very much related)
[16:33:02]<skipper_is[m]>Getting "Access Denied"
[16:33:09]<skipper_is[m]>At least it isn't a 500 error
[16:33:52]<mstenta[m]>oh are you unable to log in?
[16:34:08]<mstenta[m]>(via `/user`)
[16:34:47]<skipper_is[m]>Notice: unserialize(): Error at offset 0 of 101 bytes in UserController->attachLoad() (line 307 of /var/www/html/farm-7.x-1.x-dev/modules/user/user.module).
[16:34:47]<skipper_is[m]>Ooo
[16:35:39]<skipper_is[m]>That is really broken
[16:35:47]<mstenta[m]>eek
[16:35:57]<mstenta[m]>clear caches?
[16:36:10]<mstenta[m]>manually truncate all `cache_` tables
[16:36:24]<skipper_is[m]>The theme isn't even there, and there are no FarmOS modules in the module list
[16:37:09]<skipper_is[m]>ACTION uploaded an image: image.png (40KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/cHVhXthYyUxTOVnf... >
[16:37:21]<mstenta[m]>ok i think i know why...
[16:37:34]<skipper_is[m]>ACTION uploaded an image: image.png (112KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/QqwJaZkWzUuYTvBl... >
[16:37:35]<mstenta[m]>but not sure why it happened
[16:37:49]<mstenta[m]>Drupal has what are called "installation profiles"
[16:37:55]<mstenta[m]>farmOS is a profile
[16:38:14]<mstenta[m]>it appears that your installation thinks it is a different profile
[16:38:25]<mstenta[m]>you went through the normal install process, right?
[16:38:32]<skipper_is[m]>I did indeed
[16:40:21]<mstenta[m]>k lemme see if i can remember how to do this...
[16:40:29]<mstenta[m]>do you have mysql workbench open?
[16:40:46]<mstenta[m]>`SELECT * FROM system WHERE name = 'farm';`
[16:40:54]<mstenta[m]>and
[16:41:04]<mstenta[m]>`SELECT * FROM variable WHERE name = 'install_profile';`
[16:41:17]<mstenta[m]>(iirc)
[16:41:19]<skipper_is[m]>I do
[16:42:51]<skipper_is[m]> profiles/farm/farm.profile farm module 1 0 7049 1000 ....
[16:42:56]<skipper_is[m]>The other one is just blob data
[16:42:59]<skipper_is[m]>and the name
[16:43:20]<mstenta[m]>is it blob data, or just serialized?
[16:43:46]<mstenta[m]>is the `1` in `system` in the `status` column?
[16:44:14]<skipper_is[m]>It says "blob" under value]
[16:44:31]<skipper_is[m]>1 is status
[16:45:54]<mstenta[m]>right click on the blob and select "open value in editor"
[16:46:53]<skipper_is[m]>ACTION sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/YVReheWvYUpWAGiK... >
[16:47:09]<mstenta[m]>oh sorry... i mean for the second query
[16:47:13]<skipper_is[m]>Oh
[16:47:18]<mstenta[m]>`SELECT * FROM variable WHERE name = 'install_profile';`
[16:47:27]<skipper_is[m]>I've just run the truncate script again
[16:47:58]<skipper_is[m]>x733a343a226661726d223b
[16:48:12]<mstenta[m]>bah
[16:48:21]<mstenta[m]>that's what was in `variable`?
[16:48:32]<skipper_is[m]>x733a343a226661726d223b was in there
[16:48:39]<mstenta[m]>ha. ok.
[16:48:42]<mstenta[m]>well. that's a problem
[16:48:57]<mstenta[m]>yea... so we gotta figure out how to fix the blob issue
[16:49:28]<skipper_is[m]>So it is bringing it across as a bytea
[16:49:52]<mstenta[m]>yea, which is not getting converted to a blob
[16:52:12]<mstenta[m]>skipper_is: would you be willing to send me a dump of your postgres database that i could load into my test instance and experiment with?
[16:52:31]<mstenta[m]>i will keep it private
[16:52:59]<mstenta[m]>if i can get it migrated, i might be able to send you a mysql dump file you could import
[16:53:25]<mstenta[m]>(of course i say this at 4:52 pm on a friday... about to leave for the weekend) :-P
[16:54:35]<skipper_is[m]>Yea, I can do, I'm just testing one last thing
[16:54:51]<skipper_is[m]>restoring the variables column from my mysql backup
[16:55:00]<mstenta[m]>(don't post to this chat, of course... DM me with a link or something)
[16:55:07]<mstenta[m]>oh yea you could try that
[16:55:12]<mstenta[m]>but there will be blobs elsewhere i'm sure
[16:55:34]<skipper_is[m]>Yea, probably
[16:55:36]<skipper_is[m]>Nope, nvm
[16:56:07]<skipper_is[m]>Well, some info is there!
[16:56:11]<skipper_is[m]>ACTION uploaded an image: image.png (80KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/ahiEOuoobwRaAUqU... >
[16:56:22]<mstenta[m]>oh try clearing caches now
[16:57:49]<skipper_is[m]>A lot of errors!
[16:57:57]<skipper_is[m]>But the theme looks like it is there
[16:58:12]<skipper_is[m]>Map is destroyed
[17:00:09]<skipper_is[m]>I'm just doing a fresh dump for you
[17:00:11]<skipper_is[m]>That sounds wrong..
[17:00:34]<mstenta[m]>lol
[17:00:53]<skipper_is[m]>ACTION uploaded an image: image.png (171KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/bpZfQqjGrlFasqQc... >
[17:00:53]<mstenta[m]>do a normal postgres dump
[17:01:04]<mstenta[m]>hey that's not bad
[17:01:19]<mstenta[m]>but yea... i'd be suspicious of issues lurking in the database
[17:02:07]<mstenta[m]>> do a normal postgres dump
[17:02:07]<mstenta[m]>meaning: one that has statements for creating tables and everything... i will wipe my entire postgres database and import yours
[17:02:19]<skipper_is[m]>Ooh ok
[17:02:35]<mstenta[m]>just so i know i'm starting with exactly the same thing as you
[17:03:37]<skipper_is[m]>I've never tried to recover it from that dump
[17:04:37]<skipper_is[m]>Shall I send it to your twitter account in a PM?
[17:05:19]<mstenta[m]>sure
[17:07:55]<skipper_is[m]>Done
[17:08:02]<skipper_is[m]>I wish you the best of luck with it!
[17:08:58]<mstenta[m]>got it
[17:09:01]<mstenta[m]>no guarantees :-)
[17:09:48]<skipper_is[m]>I'm going to have to dash as well, got a hedgelaying course over the weekend, so need to get some rest before! Gnight o/
[17:10:17]<mstenta[m]>Sounds fun!
[17:10:21]<mstenta[m]>Have a nice weekend