Git Product home page Git Product logo

Comments (23)

eesheesh avatar eesheesh commented on April 27, 2024

Hi,

Can you share a screenshot of what you're seeing? Make sure to block out any private information, of course.

from import-mailbox-to-gmail.

 avatar commented on April 27, 2024

Nothing actually, no error message. I just run the command replacing the location of the json file and the mbox folder. But, nothing happens.

from import-mailbox-to-gmail.

bio5admin avatar bio5admin commented on April 27, 2024

try looking in the log file, which method are you using? Windows/Linux?

from import-mailbox-to-gmail.

 avatar commented on April 27, 2024

Where I can view the log file? I am using Windows.

from import-mailbox-to-gmail.

eesheesh avatar eesheesh commented on April 27, 2024

The log file should be import-mbox-to-gmail.log. If you can't find it, can you share a screenshot of the command you're running?

from import-mailbox-to-gmail.

roi7 avatar roi7 commented on April 27, 2024

Hi,
Please excuse me for jumping in on this thread, but I'm having the same issue. Using Win 2012 server... running the final command gets no response from the Windows Command line (as admin). However I do get syntax errors using the Python command line.

Created folders as instructed. c:\mbox\
User folder is [email protected]
I also placed the JSON file in the C:\mbox directory.

Here's the command I'm running...

import-mbox-to-gmail.py --json c:\mbox\GmailRestore-605fbe12b095.json --dir c:\mbox\[email protected] --replaceqp >> import-mbox-to-gmail.log 2>&1

I can't see the error. Do I need to include the actual .mbox file in the user directory folder in the path?
e.g. "c:\mbox\[email protected]\restored.mbox"

from import-mailbox-to-gmail.

eesheesh avatar eesheesh commented on April 27, 2024
  1. Even if you are migrating only one user, the folder you need to point the script at is still the one with the user's folder in it, not directly to the user's folder. In your case, you should run it with "--dir c:\mbox" instead of "--dir c:\mbox\[email protected]", if I understand your setup correctly.
  2. Yes, in this case, the mbox file would be in "c:\mbox\[email protected]\restored.mbox".

If it still doesn't work, check the contents of the log file (import-mbox-to-gmail.log), and share it here (with a screenshot of any errors you're seeing in the commandline). Please make sure it doesn't include any private information, of course (such as the JSON file contents, etc.).

from import-mailbox-to-gmail.

bio5admin avatar bio5admin commented on April 27, 2024

Hi guys,

if you type "c:\ more import-mbox-to-gmail.log

that should display the contents of the error log another method would be to remove everything after the --replaceqp so your command would look like this

mbox-to-gmail.py --json c:\mbox\GmailRestore-605fbe12b095.json --dir
c:\mbox\[email protected] --replaceqp

from import-mailbox-to-gmail.

roi7 avatar roi7 commented on April 27, 2024

log file contents

'import-mbox-to-gmail.py' is not recognized as an internal or external command,
operable program or batch file.

from import-mailbox-to-gmail.

bio5admin avatar bio5admin commented on April 27, 2024

Make sure you run the command from inside the importer directory see attached:

screenshot from 2016-02-11 11-51-19

from import-mailbox-to-gmail.

eesheesh avatar eesheesh commented on April 27, 2024
  1. Make sure that you closed the Command Prompt window and opened a new one after installing Python. Otherwise, it won't recognize Python scripts.
  2. If it still doesn't work, try adding "python" in the beginning, e.g. instead of "import-mbox-to-gmail.py ..." use "python import-mbox-to-gmail.py ...".
  3. If that doesn't work either, try the full python.exe path, e.g. "C:\Python27\python.exe import-mbox-to-gmail.py ..."

from import-mailbox-to-gmail.

roi7 avatar roi7 commented on April 27, 2024

Boom! Got it!
Here are the issues I had to resolve:

  1. I had not created an "importer" file containing the import-mailbox-to-gmail.py as seen in the directory structure above
  2. Did a "save link as..." out of the browser for the .py file. Had to go back and copy the raw text into the .py file to get rid of HTML language in the save
  3. The command calls for "import-mbox-to-gmail.py" but the correct name is "import-mailbox-to-gmail.py"
  4. Adding C:\Python27\python.exe to the beginning of the command line was necessary.

Final working command:
C:\Python27\python.exe import-mailbox-to-gmail.py --json c:\importer\GmailRestore.json --dir c:\mbox\ --replaceqp >> import-mbox-to-gmail.log 2>&1

Thanks for everyones input. Makes my life a whole lot easier not having to restore user emails using Thunderbird.

from import-mailbox-to-gmail.

 avatar commented on April 27, 2024

Thank you everyone for all the detailed steps. I am following them and will post back with an update about how it went for me.

from import-mailbox-to-gmail.

eesheesh avatar eesheesh commented on April 27, 2024

I updated the instructions based on your feedback - thanks! If you still encounter any issues please reopen this issue.

from import-mailbox-to-gmail.

 avatar commented on April 27, 2024

I followed all the above steps. Now, after running the command, the cursor is blinking. Does that mean that it is in the process of importing?

Also, see I the folder named "Imported Messages" inside my gmail account. But, there are no messages in it.

from import-mailbox-to-gmail.

eesheesh avatar eesheesh commented on April 27, 2024

If the cursor is blinking it means it's running, yes. You should be able to see progress in the log (import-mbox-to-gmail.log).

If no messages are being imported, can you check for any errors/exceptions in the log?

from import-mailbox-to-gmail.

 avatar commented on April 27, 2024

I am getting these errors HttpError 400 and HttpAccessTokenRefreshError

from import-mailbox-to-gmail.

eesheesh avatar eesheesh commented on April 27, 2024

For both errors, they should appear with some more context that would tell you why it failed.

Example for HttpError 400:
HttpError: <HttpError 400 when requesting https://www.googleapis.com/upload/gmail/v1/users/user%40domain.com/messages/import?internalDateSource=dateHeader&neverMarkSpam=true&fields=id&uploadType=multipart&processForCalendar=false&alt=json returned "Invalid From header">

In this case, the reason it failed is an invalid From header. To find which message you need to fix, look for a line above the error that say something like Processing message 2 in label 'INBOX', this will tell you which message in which mbox file failed.

Example for HttpAccessTokenRefreshError:
HttpAccessTokenRefreshError: invalid_grant: Not a valid email.

In this case, the reason it failed is that the email address isn't valid (doesn't exist).

If you've encountered different errors from these, please paste the full error text here and I'll take a look.

Thanks!

from import-mailbox-to-gmail.

 avatar commented on April 27, 2024

Thanks. I will try the process again.

from import-mailbox-to-gmail.

cofeVP avatar cofeVP commented on April 27, 2024

I'm also having trouble with the last step. (Running on a Mac.)

My command is:

/Users/VG/Downloads/import-mailbox-to-gmail.py --json /Users/VG/Downloads/Gmail API-[INFO DELETED].json --dir /Users/VG/Desktop/mbox

And the log error is:

-bash: /Users/VG/Downloads/import-mailbox-to-gmail.py: Permission denied

I've tried running the first bit as in the README (./import-mailbox.... at the start) and tweaking other bits inc. file permissions, but with no success.

Any help greatly appreciated. Thanks.

from import-mailbox-to-gmail.

eesheesh avatar eesheesh commented on April 27, 2024

Try running it with:
python /Users/VG/Downloads/import-mailbox-to-gmail.py --json /Users/VG/Downloads/Gmail API-[INFO DELETED].json --dir /Users/VG/Desktop/mbox

i.e. add python in the beginning.

from import-mailbox-to-gmail.

hollowoebot avatar hollowoebot commented on April 27, 2024

i contacted liron (the script author) and the README has been changed to fix this

from import-mailbox-to-gmail.

eesheesh avatar eesheesh commented on April 27, 2024

Fixed in commit 531e4ae.

from import-mailbox-to-gmail.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.