<p>You need the private key not the public key to do a sweep.</p>

<p>Actually it'll be easier if you simply copied the wallet file to the new system. If you have access to the electrum gui then you can create a copy via file > save copy. If you don't then <a href="http://docs.electrum.org/en/latest/faq.html#where-is-my-wallet-file-located" rel="nofollow noreferrer">find the wallet file</a> and copy it over.</p>

CC BY-SA 4.0
2019-06-17T01:58:57.153Z
I got private key. How do I pull several addresses in? I don't have old wallet anymore. I restored from seed
Bonfop
CC BY-SA 4.0
2019-06-18T07:43:11.293Z
The command in the OP will work fine if you use your WIF private key. [Here's](https://en.bitcoin.it/wiki/Private_key#Base58_Wallet_Import_format) a example of what that looks like.
Abdussamad
CC BY-SA 4.0
2019-06-18T07:49:01.123Z
@Bonfop I'd also like to point out that this site is not suitable for the back and forth conversation that you need. So if my comment above does not solve your problem I suggest asking for help on any one of [the community forums](https://electrum.org/#community).
Abdussamad
CC BY-SA 4.0
2019-06-15T08:10:14.263Z
2019-06-15T08:10:14.263Z
Abdussamad
<p>I have several bitcoin addresses (together with corresponding public keys) from Electrum wallet I've used previously. I moved to another CentOS server and now I need to import this addresses back.
But when I do:</p>

<pre><code>electrum sweep [public key] [btc address] -w [path to wallet]
</code></pre>

<p>I get:</p>

<pre><code>Traceback (most recent call last):
File "/usr/local/bin/electrum", line 384, in &lt;module&gt;
result = server.run_cmdline(config_options)
File "/usr/local/lib/python3.7/site-packages/jsonrpclib/jsonrpc.py", line 748, in __call__
return self.__send(self.__name, args)
File "/usr/local/lib/python3.7/site-packages/jsonrpclib/jsonrpc.py", line 630, in _request
check_for_errors(response)
File "/usr/local/lib/python3.7/site-packages/jsonrpclib/jsonrpc.py", line 1321, in check_for_errors
raise ProtocolError((code, message))
jsonrpclib.jsonrpc.ProtocolError: (-32603, 'Server error: File "/usr/local/lib/python3.7/site-packages/electrum/bitcoin.py", line 475, in deserialize_privkey | electrum.util.BitcoinException: cannot deserialize privkey 024..c0\n') 
</code></pre>

<p>What am I doing wrong?</p>

<electrum><public-key><centos><importaddress>
Centos electrum public-key import
Bonfop
# Centos electrum public-key import

(Asked by: username_0 on 2019-06-12)

I have several bitcoin addresses (together with corresponding public keys) from Electrum wallet I've used previously. I moved to another CentOS server and now I need to import this addresses back.
But when I do:

```
electrum sweep [public key] [btc address] -w [path to wallet]

```

I get:

```
Traceback (most recent call last):
File "/usr/local/bin/electrum", line 384, in <module>
result = server.run_cmdline(config_options)
File "/usr/local/lib/python3.7/site-packages/jsonrpclib/jsonrpc.py", line 748, in __call__
return self.__send(self.__name, args)
File "/usr/local/lib/python3.7/site-packages/jsonrpclib/jsonrpc.py", line 630, in _request
check_for_errors(response)
File "/usr/local/lib/python3.7/site-packages/jsonrpclib/jsonrpc.py", line 1321, in check_for_errors
raise ProtocolError((code, message))
jsonrpclib.jsonrpc.ProtocolError: (-32603, 'Server error: File "/usr/local/lib/python3.7/site-packages/electrum/bitcoin.py", line 475, in deserialize_privkey | electrum.util.BitcoinException: cannot deserialize privkey 024..c0\n') 

```

What am I doing wrong?

**Tags:** electrum, public-key, centos, importaddress


---

## 1 answers

### Answer by username_1 on 2019-06-15. Score: 1

You need the private key not the public key to do a sweep.

Actually it'll be easier if you simply copied the wallet file to the new system. If you have access to the electrum gui then you can create a copy via file > save copy. If you don't then [find the wallet file](http://docs.electrum.org/en/latest/faq.html#where-is-my-wallet-file-located) and copy it over.

> **Comments:**
> **username_0**: I got private key. How do I pull several addresses in? I don't have old wallet anymore. I restored from seed  
> **username_1**: The command in the OP will work fine if you use your WIF private key. [Here's](https://en.bitcoin.it/wiki/Private_key#Base58_Wallet_Import_format) a example of what that looks like.  
> **username_1**: @username_0 I'd also like to point out that this site is not suitable for the back and forth conversation that you need. So if my comment above does not solve your problem I suggest asking for help on any one of [the community forums](https://electrum.org/#community).  

---

