# لا يمكن تسجيل الدخول بعد الاستعادة

**URL:** https://meta.discourse.org/t/cant-login-after-restoring/82302
**Category:** Self-hosting
**Created:** [6 مارس 2018، 10:26ص UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302 "2018-03-06T10:26:21Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Seferi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/seferi/32/78808_2.png) [@Seferi](https://meta.discourse.org/u/Seferi)
#### Post date: [6 مارس 2018، 10:26ص UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302/1 "2018-03-06T10:26:21Z")

</div>

Hi,

I migrated my forum to a local device behind a Raspberry Pi Nginx reverse proxy. Installed discourse and registered and went straight to Admin section to restore from my backup. (/var/discourse/shared/standalone/backups/default) I restored successfully but afterwards I couldn’t login anymore. I tried rebuilding the app but it didn’t help. Site works fine now but it doesn’t let me login, When i try to login it says unknown error in red, when i click forgot password and enter my username i get the email to choose new password but when i enter the new password and click ok it says “Sorry, that password change link is too old. Select the Log In button and use ‘I forgot my password’ to get a new link.”  
What can I do?

---

<div class="post-metadata">

### Author: ![Vaping\_Community](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vaping_community/32/89248_2.png) [@Vaping\_Community](https://meta.discourse.org/u/Vaping_Community)
#### Post date: [6 مارس 2018، 10:48ص UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302/2 "2018-03-06T10:48:40Z")

</div>

This might seem dumb but is the time on your server correct?

---

<div class="post-metadata">

### Author: ![Vaping\_Community](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vaping_community/32/89248_2.png) [@Vaping\_Community](https://meta.discourse.org/u/Vaping_Community)
#### Post date: [6 مارس 2018، 10:51ص UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302/3 "2018-03-06T10:51:01Z")

</div>

You could try:

```
cd /var/discourse 
./launcher enter app
rake admin:create

```

This should allow you to setup a new admin account

---

<div class="post-metadata">

### Author: ![Seferi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/seferi/32/78808_2.png) [@Seferi](https://meta.discourse.org/u/Seferi)
#### Post date: [6 مارس 2018، 3:12م UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302/4 "2018-03-06T15:12:14Z")

</div>

Thanks for the reply mate. Server time is correct. I followed the steps and created a new admin account but when I try to login with it, it just shows back the login screen again.. Doesn’t work.. And sometime it says unknown error in red after trying to login..

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [7 مارس 2018، 6:52ص UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302/5 "2018-03-07T06:52:35Z")

</div>

Try to login with [http://your.site.com/users/admin-login](http://your.site.com/users/admin-login)

---

<div class="post-metadata">

### Author: ![Seferi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/seferi/32/78808_2.png) [@Seferi](https://meta.discourse.org/u/Seferi)
#### Post date: [7 مارس 2018، 9:18ص UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302/6 "2018-03-07T09:18:46Z")

</div>

I tried. It says: [“BAD CSRF”]

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [7 مارس 2018، 7:38م UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302/7 "2018-03-07T19:38:44Z")

</div>

Was the old site https and this one is http? If so you need to enter the rails console and

```
SiteSettings.force_https=false

```

---

<div class="post-metadata">

### Author: ![Seferi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/seferi/32/78808_2.png) [@Seferi](https://meta.discourse.org/u/Seferi)
#### Post date: [8 مارس 2018، 8:46ص UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302/8 "2018-03-08T08:46:01Z")

</div>

Thanks mate, how do I enter the rails console?

---

<div class="post-metadata">

### Author: ![mikechristopher](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikechristopher/32/89135_2.png) [@mikechristopher](https://meta.discourse.org/u/mikechristopher)
#### Post date: [8 مارس 2018، 9:42ص UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302/9 "2018-03-08T09:42:31Z")

</div>

If I remember right off hand its the following:

```
cd /var/discourse
./launcher enter app
rails c

```

---

<div class="post-metadata">

### Author: ![Seferi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/seferi/32/78808_2.png) [@Seferi](https://meta.discourse.org/u/Seferi)
#### Post date: [8 مارس 2018، 9:52ص UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302/10 "2018-03-08T09:52:28Z")

</div>

When i do

> [@mikechristopher](#):
>
> cd /var/discourse  
> ./launcher enter app  
> rails c

and then

> [@pfaffman](#):
>
> SiteSettings.force\_https=false

I get this:

```
[1] pry(main)> SiteSettings.force_https=false
NoMethodError: undefined method `force_https=' for SiteSettings:Module
from (pry):1:in ` __pry__'
[2] pry(main)>

```

---

<div class="post-metadata">

### Author: ![Vaping\_Community](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vaping_community/32/89248_2.png) [@Vaping\_Community](https://meta.discourse.org/u/Vaping_Community)
#### Post date: [8 مارس 2018، 10:02ص UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302/11 "2018-03-08T10:02:09Z")

</div>

~~Try wrapping `false` in quotes~~

This should work..  
`SiteSetting.force_https = false`

OR

```
s = SiteSetting.find_by(name: 'force_https')
s.value = 'false'  
s.save

```

---

<div class="post-metadata">

### Author: ![Seferi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/seferi/32/78808_2.png) [@Seferi](https://meta.discourse.org/u/Seferi)
#### Post date: [9 مارس 2018، 9:34ص UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302/12 "2018-03-09T09:34:51Z")

</div>

Thanks alot guys, it worked, I can login now.. In the process I created a few admin accounts which I don’t need. How can I delete those?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [9 مارس 2018، 9:38ص UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302/13 "2018-03-09T09:38:32Z")

</div>

Remove their admin rights. Then you can delete them.

---

<div class="post-metadata">

### Author: ![Moses\_Jeong](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moses_jeong/32/141385_2.png) [@Moses\_Jeong](https://meta.discourse.org/u/Moses_Jeong)
#### Post date: [4 يوليو 2019، 10:43ص UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302/14 "2019-07-04T10:43:05Z")

</div>

SiteSetting.force\_https = false

فقد مسافتين

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [14 يوليو 2019، 1:37ص UTC](https://meta.discourse.org/t/cant-login-after-restoring/82302/15 "2019-07-14T01:37:39Z")

</div>


