import can be done with linux console commands?
There are no linux command line tools built for this purpose. If a developer is willing to write such a tool, I would gladly provide a link to it in the README in the meantime while we work towards an account importer feature.
could you just send me the original files from you server?
This is already possible via the “export” feature shown above. In the case of image files, they are accessible via the
attachment_url property of the
image records that are exported. The data from the plants from the farm designer are available with the *.json file. You will find them under the
"points" property of the exported data.
Can I manually import the plant information for the farm designer somehow? I mean I can read the content of the json file, there must be a way to copy parts of it onto my own server and therefore have a way around planting all the plant again.
This is possible, but you will need to write this software yourself, as we have not had time to write the importer on our end yet. As far as I know, no one in the FarmBot development community has written a third party tool for this and there are no Linux command line tools that can do this out-of-the-box.
If you are willing to write the software yourself, you have a few options available (listed below).
I would like to reiterate that although it is possible, it is not a simple task and will require experimentation, as well as an understanding of SQL and a programming language. As stated previously, we do intend to add a user-friendly account importer in the future, but have not yet started work on such a feature due to time constraints.
Option 1: Use a Script + API requests
You could use a scripting language of your choice (Ruby, Lua, Python, etc) to parse the JSON and iterate over the data. You would then perform an API POST request to your personal server for each of the records.
You would need to change any / all of the fields that contain
_id attributes, since the ID of a resource is only valid on the public server.
This will require knowledge of a scripting language, an HTTP client in the language of your choice and the appropriate API endpoints.
Example API requests can be found here
Option 2: Create a Rails Runner Script ("
rails r my_script.rb")
Since it’s a private server, you can execute arbitrary Ruby code. You could, in theory write a Ruby script that parses the JSON and directly inserts the data via standard Rails ActiveRecord commands (you will need to scrub the primary / foreign keys. I can’t help here because I have not tried this)
Option 3: Raw SQL
Using the scripting language of your choice and a SQL driver, connect to the database, parse the JSON file and perform INSERT statements. Again, this will require you to manually translate the foreign / primary keys of relations. It will require knowledge of the scripting language SQL and the SQL driver of choice.