title: Postgres - Moving Data Folder
body: <p>I wanted to move my PostgreSQL data folder on my Ubuntu server and I was following <a href="https://www.digitalocean.com/community/tutorials/how-to-move-a-postgresql-data-directory-to-a-new-location-on-ubuntu-16-04" rel="nofollow noreferrer">this tutorial</a> to move it.</p>
  
  <p>I was able to move it, and update my conf file to point to the new location.</p>
  
  <p>When I go to run Postgres, it starts, but when I try to connect via </p>
  
  <pre><code>sudo -u postgres psql
  </code></pre>
  
  <p>It gives me this error:</p>
  
  <pre><code>psql: could not connect to server: No such file or directory
      Is the server running locally and accepting
      connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
  </code></pre>
  
  <p>Any ideas what happened? It says it's running. </p>