Can moving expenses be deducted only for a new job?

I looked at the IRS instructions https://www.irs.gov/publications/p521/ar02.html#en_US_2016_publink1000203446 but I am confused whether moving expenses are reserved for people who get a NEW job?

I worked remotely for my company from Dallas, TX.

My company has an office in San Francisco, CA and I moved to California and I now work to the office company in San Francisco.

Can I deduct my moving expenses or I do not qualify because I did not get a NEW job in a NEW company?

Thanks

JohnR1
New Member

Deductions & credits

if you transfer to a new location for your present employer, and meet certain conditions under IRS rules, the IRS does permit you to deduct eligible moving expenses on Form 3903, Moving Expenses.

Please see the following informative TurboTax guide on IRS Moving Expense Deductions

https://turbotax.intuit.com/tax-tools/tax-tips/General-Tax-Tips/IRS-Moving-Expense-Deductions/INF143...

Please also see the IRS instructions to Form 3903:

https://www.irs.gov/pub/irs-pdf/f3903.pdf

Deductions & credits

Ok so it is not only for new jobs. That was not clear to me. Thanks
I meet the distance test since it's more than 50 miles from Dallas to San Francisco.
I also meet the time test since I am staying in the new location for at least 1 year (> 39 weeks).

We used a moving company to move our belongings but we also drove to move our car and other belongings. I understand I can use both expenses, correct?

For the movers cost, it's easy as I have an invoice.
As for us driving, I understand it's either 19 cents multiplied by the number of miles of the shortest distance or I need the receipts for gas and hotels, correct?

Thanks