Hi Jonathan,
Oh no!
This has possibly occurred because your CSV file was not using the correct line endings and/or character encodings. This can often happen if you use Microsoft Excel, for example - Excel makes it difficult to save a CSV with UTF-8 encoding and unix style line ending charaters. Instead, it tends to default to using its own Win-Latin character encodings, and Windows-style line endings, which can cause issues on import. For more info, see:
We generally find that LibreOffice Calc is a better spreadsheet application for preparing AtoM CSV data, since it allows you to set the encoding every time you open the file, and will maintain the correct line ending characters.
That said, you are not the first person to run into this issue - and ideally, AtoM should be smart enough not to import completely blank rows!
Another community member ran into the same issue
in this thread. We ended up filling a bug ticket for the blank rows, and we have a fix that will be included in our 2.5 release, to help prevent this from happening in the future. You can see the ticket here:
We didn't end up having to help Darryl delete the blank records, because he was creating nightly backups, so he simply rolled back and fixed the CSV prior to the next import. We do strongly recommend that you get in the habit of creating backups on a regular basis, especially before making bulk changes (like imports) into a production environment! We haven't tested this method ourselves, but Darryl did share the following:
I’m doing nightly backups of the Percona databases (using something I found on GitHub https://github.com/sixninetynine/surrogate)
You could probably also use a
cron job to schedule nightly backups.
In the meantime, that doesn't help you! And I do think it would be useful for us to have a SQL query on hand to delete blank descriptions, so I will speak to our developers and see if we can craft something. Note that it may be complicated to do so, however, because data is added to several MySQL tables for each row imported, e.g. object, information_object, information_object_i18n, object_term_relation, slug, status.
If we're able to provide you with a SQL query you can use for this, then first you will need to access the MySQL database from your command-line terminal, to be able to run the query. To do so, you will need to know the username, password, and database name you used during the installation process. Here is the basic structure of the command to open the MySQL terminal:
- mysql -u username -pPASSWORD dbName
For example, assuming your user and password are root and your database name is atom, you can access the MySQL terminal like so:
- mysql -u root -proot atom
This should open the MySQL prompt. If you don't recall the database name and credentials you used during installation, you can double-check them in the config/config.php configuration file. You could use nano to open this file:
Now we should be ready to run any relevant SQL query.
If we're not able to provide such a query, then you do have one more workaround option: go nuclear! :)
The following command will purge ALL data from your database. If you only have a few descriptions (minus the ones in your CSV, which you should fix and reimport after making a backup), then exporting them first via the Clipboard might be a viable option. Remember that if you have detailed authority records and repository records you might want to export them separately, since only minimal details for these related entities are included in the archival description CSV export. When you re-import, I'd start with the repository record(s), then the authority records, then the descriptions last.
If you want to purge all data in your site, use the following command:
Anyway, I will see if we are able to craft a query that will help you target only these blank rows. Stay tuned.
Regards,