How do I get the Server ID when Confluence won't start
Asked by DaveF:

My licence expired and I have purchased a new one. To get the licence I need to:

To get your Server ID:

1. Log in as a Confluence administrator
2. Click on the Settings icon and choose **General configuration**
3. Click on the **License Details** link (under '*Administration*')
4. Your Server ID is listed in the **Server ID** field  

   <br />

Since Confluence won't start it just gives me a "put in your licence" screen. How do I find the Server ID.


Answers:
author: Bryan Trummer - ReleaseTEAM
body: Hi [@DaveF](/t5/user/viewprofilepage/user-id/527818) - You might want to take a look at this Confluence Knowledge Base article. It includes a SQL query that you can run to hopefully bring you back that information.

<https://confluence.atlassian.com/confkb/what-is-the-confluence-server-id-151519275.html>

comments: author: Hal9000
body: Dear Atlassian. Why must it be so difficult? Please display the server ID on the licence entry form. Make it easy for you to get paid? Win for both of us right?


author: Mehran
body: I absolutely don't get it, why Atlassian Team made every simple thing so complicated. It's about 2 hours I took just to understand how to delete an organization and still no success. An we're not talking about a comprehensive action, just an easy delete option.   
And now looking for my Confluence Server ID.  

If the perdition of Atlassian Team was, developers have so much free time just to chill in Atlassian account just to figure out how to do a simple process, well you guys should think about it again.  


author: Metin Savignano
body: [@Bryan Trummer - ReleaseTEAM](/t5/user/viewprofilepage/user-id/853494)'s answer wouldn't work for me, as I was using the H2 database for a test instance.

However, it's probably even simpler to search the log. You should be able to find a group of lines like these which contain the server ID:

```
--------------------------
Build Information
--------------------------
maxUsers = -1
installationDate = Fri Nov 01 18:29:59 GMT 2019
supportEntitlementNumber = SEN-L12345678
buildNumber = 8401
serverId = ABCD-CAFE-1234-WXYZ
version = 7.2.0
home = /var/atlassian/application-data/confluence
upTime = 4 minutes, 26 seconds
baseUrl = http://localhost:8090
devMode = false
```

comments: author: Evan W
body: Umm, which log file and where is it located. I cannot find a log file with this information.


author: Metin Savignano
body: [@Evan_W](/t5/user/viewprofilepage/user-id/545811) , on Linux it is usually at /var/atlassian/application-data/confluence/logs/atlassian-confluence.log

For more details about Confluence logfiles, see <https://confluence.atlassian.com/doc/working-with-confluence-logs-108364721.html>


author: Evan W
body: Hey Metin, thanks for the tip, but I couldn't find the log. It took sometime, and by the way Atlassian, what's with showing a dialogue box without simply showing the server id! Seems like a bug to me.

This is my solution - only took me a day to piece together - again thanks Atlassian.

1. I needed to interrogate a table in postgres, but I had to login to postgres. Unfortunately my credentials weren't working, so I had to set the database to not require a password ([source](https://www.dbrnd.com/2018/04/postgresql-how-to-recover-postgres-user-password/))

2. Install locate

   |-----------------------------|
   | `$ sudo apt install locate` |

3. Update the locate database

   |--------------|
   | `$ updatedb` |

4. Locate the file **pg_hba.conf**.

   |-------------------------------------------------------------------------------------------------------------------|
   | `$ locate pg_hba.conf` `/etc/postgresql/``10``/main/pg_hba.conf``/usr/share/postgresql/``10``/pg_hba.conf.sample` |

5. Edit pg_hba.conf file:

   |------------------------------------------------------------------------|
   | `# IPv4 local connections:``host all all ``127.0``.``0.1``/``32` `md5` |

6. Change below line for MD5 to TRUST

   |--------------------------------------------------------------------------|
   | `# IPv4 local connections:``host all all ``127.0``.``0.1``/``32` `trust` |

7. Restart the PostgreSQL Server:

   |-----------------------------------------|
   | `$ sudo /etc/init.d/postgresql restart` |

8. Connect the PostgreSQL:

   |---------------------------------------------------------|
   | `psql -h localhost -U postgres``password? ``"password"` |

9. Now in the psql environment.

10. Change the password

    |----------------------------------------------------------------------|
    | `confluence=# ALTER USER postgres with password ``'new_password'``;` |

11. List all of the databases

    |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
    | `postgres=# \l` `confluence | postgres | UTF8 | en_AU.UTF-``8` `| en_AU.UTF-``8` `|`` ``postgres | postgres | UTF8 | en_AU.UTF-``8` `| en_AU.UTF-``8` `|`` ``template0 | postgres | UTF8 | en_AU.UTF-``8` `| en_AU.UTF-``8` `| =c/postgres +`` ``| | | | | postgres=CTc/postgres`` ``template1 | postgres | UTF8 | en_AU.UTF-``8` `| en_AU.UTF-``8` `| postgres=CTc/postgres+`` ``| | | | | =c/postgres` |

12. Select the confluence database

    |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
    | `postgres=# \c confluence``SSL connection (protocol: TLSv1.``3``, cipher: TLS_AES_256_GCM_SHA384, bits: ``256``, compression: off)``You are now connected to database ``"confluence"` `as user ``"postgres"``.``confluence=#` |

13. Look up the server id

    |-------------------------------------------------------------------------------------|
    | `confluence=# SELECT * FROM BANDANA WHERE bandanakey = ``'confluence.server.id'``;` |

14. The resultant server ID is shown (now you can paste into the licence generation page on the Atlassian site and finally retrieve the missing key).
15. Quit from postgres

    |-------------------|
    | `confluence=# \q` |

16. Restart the server

17. Done (Simple eh).


Tags: confluence-server

server