<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Moving data directory - postgresql could not be started in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/moving-data-directory-postgresql-could-not-be-started/m-p/256322#M209452</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A background of the situation - We have alfresco 4.0.d set up on ubuntu/tomcat/postgres. Originally, during testing, the contentstore was at /opt/alfresco/alf_data. I copied the directory as a whole to /mnt/alf_data and modified the alfresco-global.properties-&amp;gt;dir.root property to match.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This appeared to work - restarted the server, could see the files in the repository and the test spaces which had been setup. It was only later in the day I noticed a red "Could not Retrieve tags" warning. This was accompanied by - &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;org.alfresco.repo.search.impl.lucene.LuceneQueryParserException: 03110615 Request failed 404 /solr/alfresco/alfresco?q=PATH%3A%22%2Fcm%3Ataggable%22&amp;amp;wt=json&amp;amp;fl=*%2Cscore&amp;amp;rows=2147483647&amp;amp;df=TEXT&amp;amp;start=0&amp;amp;locale=en_US&amp;amp;fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; when trying to add a tag.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I changed /opt/alfresco/alf_data to /opt/alfresco/alf_data-old to see if it was related to the old or the new directory and restarted the server again - big problems. Postgres was unable to start, referring to a missing .conf file. I have found a few possible causes of this issue so far (obviously they weren't the whole problem as it persists) - &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1 Permissions - as I used sudo cp to move the files they were all owned by root. In the original location this was actually par for the course, excepting the postgresql directory all the files and folders in alf_data were owned by root. I used "sudo chown -R postgres&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;ostgres postgresql/" inside the new directory and made sure that it was set up for 0700 permissions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2 postgres configuration - in /opt/alfresco/postgresql/scripts there was a script called ctl.sh which seems to be hardcoded to the original alf_data location. I didn't do the initial install of our setup so unfortunately I can't say for sure where this came from but I'd hazard a guess that it was generated by the web quick start installation. Towards the very top of this file 2 variables are defined - &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;POSTGRESQL_PIDFILE=/opt/alfresco/alf_data/postgresql/postmaster.pid&lt;BR /&gt;&lt;BR /&gt;POSTGRESQL_START="/opt/alfresco/postgresql/bin/postgres -D /opt/alfresco/alf_data/postgresql -p 5432"&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;so I changed this to &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;POSTGRESQL_PIDFILE=/mnt/alf_data/postgresql/postmaster.pid&lt;BR /&gt;&lt;BR /&gt;POSTGRESQL_START="/opt/alfresco/postgresql/bin/postgres -D /mnt/alf_data/postgresql -p 5432"&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;then saved and restarted the server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It still gives me, in the logs - &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;/opt/alfresco/postgresql/scripts/ctl.sh : postgresql&amp;nbsp; could not be started&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;I have looked through /postgresql/scripts/ctl.sh and found the command to start postgres - &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt; su postgres -c "$POSTGRESQL_START &amp;amp;"&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;and tested it &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;sudo su postgres -c "/opt/alfresco/postgresql/bin/postgres -D /mnt/alf_data/postgresql -p 5432"&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;which works fine (or at least, does not return an error).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems to me that somewhere, in some script, the path to alf_data has been hard coded, rather than referenced from dir.root, however I'm stumped as to where and why it is that postgres cannot start. Any thoughts or pointers appreciated&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We never fully figured out the problems with pointing the data.dir at another folder. I wouldn't suggest it unless you have a good set of backups at your disposal. What we did to get around this, in case it helps anyone else, was to reinstall alfresco (we used the linux quick installer, if you do too you'll need to select no when it asks at the very end whether you would like to start the alfresco service). After installing, our process was as follows -&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-mount the network location to be used as data directory in a temporary location. For us, &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;sudo mount ip.address.of.nas:/alf_data /opt/alfresco-4.0.d/alf_data_mount&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;-copy the files from the installation alf_data to the new data directory. Again, the command for us was - &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;sudo cp -p -r alf_data/* alf_data_mount/&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;-Make sure the Owner/Group/Permissions match between the two folders (especially /postgres)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-unmount the new data dir. ours - &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;sudo umount ip.address.of.nas:/alf_data&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;-remount it at the original data directory location - &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;sudo mount ip.address.of.nas:/alf_data /opt/alfresco-4.0.d/alf_data&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;-If you are using SOLR, set it up now, following the Wiki. Delete the existing Index stores as it will need to rebuild them on first startup.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Start Alfresco - &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;sudo ./alfresco.sh start&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems, at least with the quick installer, that a few items are hardcoded to the original alf_data directory. This turned out to be the easiest way (for us) to have a mounted resource as a data directory. I'm sure we could have eventually sorted out the various scripts pointing to this location but I figure this way, from the Alfresco Server's perspective, the data dir will always be the same one it was installed to use.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Apr 2012 05:46:26 GMT</pubDate>
    <dc:creator>chrisokelly</dc:creator>
    <dc:date>2012-04-11T05:46:26Z</dc:date>
    <item>
      <title>Moving data directory - postgresql could not be started</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/moving-data-directory-postgresql-could-not-be-started/m-p/256322#M209452</link>
      <description>A background of the situation - We have alfresco 4.0.d set up on ubuntu/tomcat/postgres. Originally, during testing, the contentstore was at /opt/alfresco/alf_data. I copied the directory as a whole to /mnt/alf_data and modified the alfresco-global.properties-&amp;gt;dir.root property to match.This appe</description>
      <pubDate>Wed, 11 Apr 2012 05:46:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/moving-data-directory-postgresql-could-not-be-started/m-p/256322#M209452</guid>
      <dc:creator>chrisokelly</dc:creator>
      <dc:date>2012-04-11T05:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Moving data directory - postgresql could not be started</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/moving-data-directory-postgresql-could-not-be-started/m-p/256323#M209453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Related topic that should give an answer: &lt;/SPAN&gt;&lt;A href="https://forums.alfresco.com/forum/developer-discussions/development-environment/postgresql-not-starting-after-moving-alfdata" rel="nofollow noopener noreferrer"&gt;https://forums.alfresco.com/forum/developer-discussions/development-environment/postgresql-not-starting-after-moving-alfdata&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 07:15:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/moving-data-directory-postgresql-could-not-be-started/m-p/256323#M209453</guid>
      <dc:creator>mathias_lin</dc:creator>
      <dc:date>2015-09-15T07:15:40Z</dc:date>
    </item>
  </channel>
</rss>

