< 062019-11-07⋎08 >

farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Feature requests and bug reports: github.com/farmOS/farmOS/issuesSet by ChanServ on 2018-08-16 at 14:32
02:17*FijiDave_ has joined
02:19*FijiDave has quit (Ping timeout: 276 seconds)
05:47*FijiDave has joined
05:49*JustTB has quit (Quit: Leaving.)
05:51*FijiDave_ has quit (Ping timeout: 276 seconds)
06:29*cloaz has quit (Ping timeout: 276 seconds)
06:30*cloaz has joined
08:02*JustTB has joined
08:06*JustTB has quit (Client Quit)
08:17*JustTB has joined
19:24*FijiDave has quit (Quit: Leaving...)
19:29*FijiDave has joined
19:46skipper_is[m]I didn't see it in the API documentation, hence the question
19:55skipper_is[m]I am assuming it isn't just file.json?id=84
19:58mstenta[m]maybe?
19:58mstenta[m]tbh i don't know if i've ever tested it
19:59mstenta[m]we've tested uploading files (because Field Kit does that)... not sure if we ever needed downloading files
19:59mstenta[m]ultimately, it should just give you metadata about the file
19:59mstenta[m]which will include the file path - then you can download that directly
20:05paul121[m]Good question... Does Field Kit uses the API to upload images I'm assuming?
20:06mstenta[m]Yup
20:07mstenta[m]Which is pretty simple right now... you basically have to encode the file as base64 and include it in the JSON
20:08mstenta[m]The restws module itself doesn't support file uploads, but the add-on restws-file module extends it to accept base64
20:08mstenta[m]I'm curious to see how files are handled in the Drupal 8 API
20:09paul121[m]Neat
20:11paul121[m]Reminds me I need to document more of farmOS.py
20:11paul121[m]File upload/download could be included
21:30skipper_is[m]I'm looking at using farmOS.py to migrate everything from Postgresql to mysql, but the files are the one thing that is not making life easy at the moment
21:32skipper_is[m]But file.json?id=84 us returning 403, forbidden...
21:33mstenta[m]yikes would that be necessary for a migration? is a pgsql dump that different from a mysqldump?
21:33skipper_is[m]Yup
21:33skipper_is[m]Unfortunately
21:33mstenta[m]it would probably be a whole lot safer to try to import `INSERT` statements from a pgsql dump
21:34mstenta[m]really? what is different about it?
21:34skipper_is[m]different ways of variable stores maybe?
21:34skipper_is[m]was making a fuss about var(255)
21:34mstenta[m]huh - i would think the `INSERT` statements are identical though
21:34mstenta[m]you wouldn't need to include any `CREATE TABLE` statements...
21:35mstenta[m]this is what I would try:
21:35mstenta[m]install a brand new fresh farmOS instance on MariaDB
21:35mstenta[m]run `TRUNCATE` on all the tables
21:35skipper_is[m]The insert statements for pgsql dump are not insert tables
21:35mstenta[m]get a pgsql dump that is ONLY `INSERT` statements
21:35skipper_is[m]by default
21:35mstenta[m]and import that into mariadb
21:36skipper_is[m]COPY public.farm_sensor_data (id, "timestamp", name, value_numerator, value_denominator) FROM stdin;
21:36skipper_is[m]901568477315temp2279100
21:36skipper_is[m]901568477315hum4142100
21:37mstenta[m]try this maybe: stackoverflow.com/questions/2857989/usin
21:37skipper_is[m]Ah good shout
21:37mstenta[m]`pg_dump --column-inserts --data-only <database>`
21:37mstenta[m](no idea if that will do what we want... but worth a shot!)
21:37skipper_is[m]Yea, will give it a spin
21:38mstenta[m]oh with `> my_dump.sql` at the end to dump to file
21:38mstenta[m]`pg_dump --column-inserts --data-only <database> > my_dump.sql`
21:38skipper_is[m]pg_dump --no-owner --column-inserts --data-only farmos > farmosbackup.sql
21:38mstenta[m]and then on the mariadb/mysql side:
21:39mstenta[m]`mysql -u <username> --password=<password> <database> < farmosbackup.sql `
21:39mstenta[m](i think - that's off the top of my head)
21:39skipper_is[m]Oh I need to truncate the cache tables first..
21:39skipper_is[m]Still no idea why clear CC isn't working
21:41mstenta[m]if you have drush, i think `drush cc all` would do it
21:42skipper_is[m]Yea, drush is being a bit weird now though
21:42mstenta[m]:-(
21:43skipper_is[m]Had to get the premade release from the drupal website, rather than just building my own with drush
21:43skipper_is[m]Which is probably an easier way to go anyway
21:46skipper_is[m]I should probably set up a farmOS instance using mysql first shouldnt I..
21:46mstenta[m]Yea might as well
21:49skipper_is[m]Does mysql have schemas?
21:49skipper_is[m]Might be a daft question I know...
21:51mstenta[m]it has tables with columns... is that what you mean?
21:51mstenta[m]stackoverflow.com/questions/11618277/dif
21:52mstenta[m]does postgresql use "schema" differently?
21:53skipper_is[m]Yea, they're a bit more like folders
21:54skipper_is[m]so my farmos tables are located in the public schema, so the cache table is public.cache
21:54skipper_is[m]My insert statements are therefore INSERT public.cache .....
21:54skipper_is[m]And mysql is very unhappy about that..
21:55mstenta[m]oh
21:55skipper_is[m]It is an easy fix
21:55mstenta[m]can you run a search and replace on the sql dump file?
21:55skipper_is[m]find replace public. with nothing
21:55mstenta[m]:-)
21:55mstenta[m]this is all good to know... i've never had to migrate from postgresql to mysql
21:56skipper_is[m]But because the dump doesn't have create, I can't dump it into a blank install
21:56mstenta[m]worth noting.... i am hoping to make postgresql the recommended database in farmOS 2.x
21:56skipper_is[m]Have to install with the similar tables
21:56skipper_is[m]well, same named tables
21:56mstenta[m]and the migration will be automated so you won't have to worry about all this again :-)
21:56skipper_is[m]:)
21:56skipper_is[m]I would stick with Postgresql, but it just adds that extra layer of complexity and uncertainty for deploying it to my farm workers
21:57mstenta[m]www.drupal.org/project/farm/issues/29088
21:57mstenta[m]yea... farmOS 1.x has been developed/tested thoroughly on MySQL/MariaDB... so that's definitely the safest
21:58mstenta[m]for farmOS 2.x, i'm going to start using PostgreSQL myself, so all dev/testing will be done with it :-)
21:59skipper_is[m]Ah nice :) I do like Postgres, though mainly as it was my base DB when doing GIS with the National Parks
21:59skipper_is[m]And the PostGIS extension is really handy for GIS
21:59skipper_is[m]Might be worth leveraging that for FarmOS
22:00mstenta[m]yes! i'm excited to explore those possibilities
22:00mstenta[m]although from what i've heard, mariadb has some good GIS options now too
22:00mstenta[m]but PostGIS has been around longer, so I'm sure it's more mature
22:01skipper_is[m] postgis.net/docs/manual-3.0/PostGIS_Spec Has a good list of functions too
22:02mstenta[m]it would certainly require some consideration, though: whether or not to require PostGIS... or if we still want to allow users to install farmOS on MySQL as well
22:02mstenta[m]that would add another barrier to self-hosting for some
22:02mstenta[m](unless they use Docker)
22:03skipper_is[m]Indeed
22:04skipper_is[m]Well, I'm installing a fresh version now, and will insert all in the table when it is done
22:05mstenta[m]cool! eager to hear how it goes!
22:06skipper_is[m]I suspect it is going to go interestingly... As I haven't truncated everything created by the install process
22:07mstenta[m]oh you defininitely need to do that!
22:07mstenta[m]definitely definitely
22:07mstenta[m]you'll get lots of errors otherwise
22:07mstenta[m]duplicate entries and whatnot
22:07mstenta[m]not for logs/assets/areas... but for other things like Drupal variables
22:07mstenta[m]field definitions
22:07skipper_is[m]The installing process under "install optional modules" is that just creating everything in the tables?
22:07mstenta[m]etc etc
22:08skipper_is[m]or is there some other funky jazz it is up to?
22:08mstenta[m]oh that's another good point... make sure you install all the same modules you have installed on the pgsql site
22:08mstenta[m]to make sure all the same tables are there
22:09mstenta[m]> The installing process under "install optional modules" is that just creating everything in the tables?
22:09mstenta[m]that will create the database tables, yes. and also put things in some of them. but you should truncate them. you need the tables to be created, but you need them to all be empty.
22:09skipper_is[m]Yea, but can I interupt the install?
22:09skipper_is[m]It is on like 2/23, and taking forever
22:11mstenta[m]oh ... no don't interrupt the install
22:11mstenta[m]sorry...
22:11mstenta[m]i thought you started your import already
22:12*sent a long message: < matrix.org/_matrix/media/r0/download/mat >
22:13skipper_is[m]Ok, I'll leave it run :(
22:13skipper_is[m]Just looking how to easily truncate all tables...
22:13mstenta[m]Do you have linux?
22:13mstenta[m]Or actually doesn't matter... I use MySQL Workbench, which is a client app that works on all OSes
22:14mstenta[m]I think you can truncate all tables with that GUI
22:14skipper_is[m]I do, but I'm just using webmin for most things
22:18skipper_is[m]I should probably use MySQL Workbench.....
22:18skipper_is[m]Webmin is refusing to process more than 1 sql command at once... As soon as it sees a ; it stops...
22:19mstenta[m]So with MySQL Workbench you can right click on a table and "Truncate table"
22:19mstenta[m]You may be able to select all tables at once and truncate them all at once
22:19mstenta[m]That's why I suggested it
22:19skipper_is[m]Yea, but for 215 tables...
22:20skipper_is[m]I just dumped the table list, and did a find/replace for a new line with "TRUNCATE TABLE "
22:20mstenta[m]Just an idea... whatever's easiest :-)
22:20mstenta[m]That works too
22:20skipper_is[m]I think they're all empty, as FarmOS is now very unhappy and refusing to load
22:20mstenta[m]haha
22:20mstenta[m]the install finished first I assume?
22:21skipper_is[m]It did
22:25skipper_is[m]MySQL Workbench is slowly chewing through the insert lsit
22:25skipper_is[m]list
22:25skipper_is[m]Ah nuts, not all the modules were installed
22:27mstenta[m]ah
22:27mstenta[m]Gonna need to start over probably :-/
22:27mstenta[m]I also probably wouldn't recommend using Workbench for the import
22:27mstenta[m]Raw commandline might be faster
22:28mstenta[m]I gotta run... will check in on your progress later. Good luck! :-)
22:31skipper_is[m]It is quite handy as it flags it up nicely
22:34*JustTB has quit (Ping timeout: 240 seconds)
22:34*JustTB1 has joined
23:09skipper_is[m]So many little differences that kept flagging up, not worth it!
23:10skipper_is[m]Could take weeks to go through the dump and clean it up
23:26mstenta[m]:-(
23:27mstenta[m]What kinds of things came up?
23:36paul121[m]Quick question
23:36paul121[m]I thought languages were configurable per user? Is that wrong?
23:45*JustTB1 has quit (Ping timeout: 268 seconds)

< 062019-11-07⋏08 >