How to change All Archival Description DRAFT to Published

56 views
Skip to first unread message

afb...@gmail.com

unread,
Jan 24, 2019, 6:51:16 AM1/24/19
to AtoM Users
Hi,


I need to change the draft publications to published one time. it is possible to do in some way, by the application or Database. Has anyone done anything similar?

Best Regards,
AM

Dan Gillean

unread,
Jan 24, 2019, 1:56:16 PM1/24/19
to ICA-AtoM Users
Hi Andre, 

If you want to change every archival description in your AtoM site to published, you can use SQL to do this. All of the following commands should be run from the root AtoM installation directory - if you've followed our recommended installation instructions, this is generally /usr/share/nginx/atom.  

You'll need access to the command-line of your installation, and you'll need to know the MySQL credentials used during installation. If you made no changes during installation, then these might still be set as root for both user and password - in that case, you can enter the MySQL terminal like so: 
  • mysql -u root -proot atom
If this is successfull, then you will see a brief introductory output, and then the mysql prompt where you can enter SQL queries directly. I'll include a screenshot below of my console as I input the commands. 

If that doesn't work and you aren't sure what credentials are being used for your MySQL user, you can check these in config/config.php -see: 
Now, before we make the change to publish all descriptions in AtoM, let's check how many you have, so we can check it again after. 

You can enter the following in AtoM's global search box when logged in to see all draft records returned: 
  • publicationStatusId:159
For example, there are 157 draft records in the AtoM public demo site (remember to log in to the demo site before following this link!): 
Now we're ready to change all descriptions to draft. In the MySQL terminal you can enter the following query: 

If the query runs successfully, then you can enter exit afterwards to leave SQL mode and return to the unix command prompt. 

Here's a sample output of me entering SQL mode and running this SQL query in my local Vagrant test environment: 

sql-update-draft-descriptions-to-published.png

We're almost done, but there are a few final things we'll want to do to be able to see our changes in AtoM. Right now the changes have been made in the database, but our search index hasn't been updated, so if we try our publicationStatusId search again, we'll still see draft records. Additionally, AtoM makes use of caching to help speed up delivery, but we'll want to clear our caches and restart services, to make sure we're seeing the most up to date results. 

First, let's restart PHP-FPM and memcached - both of these services involve caching, and restarting them will flush the current caches. The instructions below assume you are using Ubuntu 16.04 with PHP 7.0 for your installation - if you are using Ubuntu 14.04 and PHP 5.x, let me know and I can provide alternate commands. 
  • sudo systemctl restart php7.0-fpm
  • sudo systemctl restart memcached
Now let's clear the application cache, and repopulate our search index: 
  • php symfony cc
  • php symfony search:populate
We should be good to go! Don't forget that your web browser has its own cache, so you might want to clear it as well, or test first in a private/incognito browser window (where the browser cache is generally disabled by default). 

Let us know how it goes! 

Cheers, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory


--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/a6e52167-2ce0-4733-9d60-e1a9ed00744f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages