title: How to manually save a new user from the rails console when using devise?
body: <p>I have an app with a single user, and want to clear the db and start again.</p>
  <p>I saved the user table and cleared the db, and now want to create the single user in the new db.</p>
  <p>I could do something like <a href="https://stackoverflow.com/a/25539744/5783745">this</a>:</p>
  <pre class="lang-rb prettyprint-override"><code>user = User.new(
    email: &quot;testm@example.com&quot;, 
    password: &quot;1234&quot;,
    admin: false,
    time_zone: &quot;International Date Line West&quot;,
    first_name: &quot;testm&quot;,
    last_name: &quot;testm&quot;
    )
  </code></pre>
  <p>The problem is, I don't know their password (nor should I), and I can't figure out how to take their existing &quot;encrypted_password&quot; and insert it into the new database (I have the standard devise string that looks like so <code>&quot;$2a$12$13Mu.SLk/M2KOFaqFkYAg.lTmq0mnqoWh6kL186yeK/yumS6C70HG&quot;</code>)</p>
  <p>How do I create a record and provide to it the devise string as the value for <code>encrypted_password</code>?</p>
  <p>Note: attempting to add <code>encrypted_password: &quot;$2a$12$13Mu.SLk/M2KOFaqFkYAg.lTmq0mnqoWh6kL186yeK/yumS6C70HG&quot;</code> to the above simply results in:</p>
  <pre><code>ActiveRecord::RecordInvalid: Validation failed: Password can't be blank
  </code></pre>